var winDebug;

    var __researchFixWindow;
    var __researchFixMenu;
	var __multiBasisResearch;
    var __emulatorActive = false;
	var __initParams = "";
	var __defStatus = "";
	var __defFund = "";
	var __defCusip = "";
	var __defClcBasis = "";
	var __bgmmAccIdx = 0;
	var __bcarAccIdx = 0;
	var __btrdAccIdx = 0;
	var __ctdaAccIdx = 0;
	
	var __baseUrl;

	var __parFndInput = "";//Parent scr fund input value
	var __parCntlArr = new Array();//Parent scr populate Control Array
	var __frmFndInput = "";//Browse scr fund input value

	var __BGMM_formWindow = null;
	var __BGMM5_formWindow = null;
	var __BCAR_formWindow = null;
	var __BTRD_formWindow = null;
	var __CTDA_formWindow = null;
	var __BGLM_formWindow = null;
	var __BRFD_formWindow = null;
	var __BRKP_formWindow = null;

	//Module ID Constants
	__CONST_BGMM  = "BGMM";
	__CONST_BGMM5 = "BGMM5";
	__CONST_BCAR  = "BCAR";
	__CONST_BTRD  = "BTRD";
	__CONST_CTDA  = "CTDA";
	__CONST_BGLM  = "BGLM";
	__CONST_BRFD  = "BRFD";
	__CONST_BRKP  = "BRKP";
	__CONST_MULT_LOT_DET = "Multibasis-Lot-Details";
	__CONST_LOT_WITH_DET = "Lot-Witholding-Details";
	__CONST_LOT_ADJ_DET  = "Lot-Adjustment-Details";
	__CONST_RES_MENU_ID = "research";
	__CONST_MULT_BAS_MENU_ID = "multiBasisResearch";

	//Associative Array For Tab Titles
	var __tabTitleArray = new Array();
	__tabTitleArray[__CONST_BGMM] = "BGMM";
	__tabTitleArray[__CONST_BGMM5] = "BGMM5";
	__tabTitleArray[__CONST_BCAR] = "BCAR";
	__tabTitleArray[__CONST_BTRD] = "BTRD";
	__tabTitleArray[__CONST_CTDA] = "CTDA";
	__tabTitleArray[__CONST_BGLM] = "BGLM";
	__tabTitleArray[__CONST_BRFD] = "BRFD";
	__tabTitleArray[__CONST_BRKP] = "BRKP";
	__tabTitleArray[__CONST_MULT_LOT_DET] = "Multibasis Lot Details";
	__tabTitleArray[__CONST_LOT_WITH_DET] = "Lot Witholding Details";
	__tabTitleArray[__CONST_LOT_ADJ_DET]  = "Lot Adjustment Details";	
	
	function toString(obj,showAttr,inWindow)
	{
		var prp
		var msg = obj + "\n=====================================\n"
		if(showAttr)
		{
			for(prp in obj)
			{
				msg = msg + prp + ":" + obj[prp] +"\n"
			}
		}
		if (!inWindow)
		{
			alert(msg)
		}
		else
		{
			if (!winDebug)
			{
				winDebug = open("")
			}
			else
			{
				if (winDebug.closed)
				{
					winDebug = open("")
				}
			}
			msg = msg.replace(/[\n]/g, "<BR>")
			msg = msg.replace(/ /g, "&nbsp;")
			winDebug.document.write(msg)
		}	
	}    
    
    function __onResearchFixWindowHide()
    {
    	if (__emulatorActive)
    	{
    		divView.gotoFunction('?END');
    		__emulatorActive = false;
    	}	
    }
    
    function __onResearchFixWindowShow()
    {		
    }

	function __closeAllInputWindow()
	{
		if(__BGMM_formWindow != null)
		{
			__BGMM_formWindow.hide();
		}
		if(__BGMM5_formWindow != null)
		{
			__BGMM5_formWindow.hide();
		}
		if(__BCAR_formWindow != null)
		{
			__BCAR_formWindow.hide();
		}
		if(__BTRD_formWindow != null)
		{
			__BTRD_formWindow.hide();
		}
		if(__CTDA_formWindow != null)
		{
			__CTDA_formWindow.hide();
		}
		if(__BGLM_formWindow != null)
		{
			__BGLM_formWindow.hide();
		}
		if(__BRFD_formWindow != null)
		{
			__BRFD_formWindow.hide();
		}
		if(__BRKP_formWindow != null)
		{
			__BRKP_formWindow.hide();
		}
	}
	
    function __onBrowseMenu(item)
    {
		__closeAllInputWindow();
    	if (item.id == __CONST_BGMM || item == __CONST_BGMM)
		{
			__BGMM_showForm();
		}
		else if(item.id == __CONST_BCAR || item == __CONST_BCAR)
		{
			__BCAR_showForm();
		}
		else if(item.id == __CONST_BTRD || item == __CONST_BTRD)
		{
			__BTRD_showForm();
		}
		else if(item.id == __CONST_CTDA || item == __CONST_CTDA)
		{
			__CTDA_showForm();
		}
		else if(item.id == __CONST_BGLM || item == __CONST_BGLM)
		{
			__BGLM_showForm();
		}
		else if(item.id == __CONST_BRFD || item == __CONST_BRFD)
		{
			__BRFD_showForm();
		}
		else if(item.id == __CONST_BRKP || item == __CONST_BRKP)
		{
			__BRKP_showForm();
		}
		else if(item.id == __CONST_BGMM5 || item == __CONST_BGMM5)
		{
			__BGMM5_showForm();
		}
		else
		{
			alert(item.id);
		}
    }

	//Method to get the Menu Items based on parent Menu ID
    function __getMenuItems(aPMenuId)
	{
		if(aPMenuId != null && aPMenuId != undefined && aPMenuId != "")
		{
			if(aPMenuId == "research")
			{
				var menuItemArr = [
									{
										id: __CONST_BGMM,
										text: 'F.I./S.T. Lots (BGMM)',
										handler: __onBrowseMenu
									},
									{
										id: __CONST_BCAR,
										text: 'Corporate Action (BCAR)',
										handler: __onBrowseMenu
									},
									{
										id: __CONST_BTRD,
										text: 'SMAC Open/Settled Trade (BTRD)',
										handler: __onBrowseMenu
									},
									{
										id: __CONST_CTDA,
										text: 'Custody Activity (CTDA)',
										handler: __onBrowseMenu
									}
								];
				return menuItemArr;
			}
			else if(aPMenuId == "multiBasisResearch")
			{
				var menuItemArr = [
									{
										id: __CONST_BGMM5,
										text: 'F.I./S.T. Lots (BGMM)',
										handler: __onBrowseMenu
									},
									{
										id: __CONST_BRFD,
										text: 'Daily Position Browse (BRFD)',
										handler: __onBrowseMenu
									},
									{
										id: __CONST_BRKP,
										text: 'Browse Record Keeping File (BRKP)',
										handler: __onBrowseMenu
									}
								];
				return menuItemArr;
			}
		}		
	}

    function __getResearchFixWindow()
    {
    	if (!__researchFixWindow)
    	{    		    
    		__researchFixWindow = new Ext.Window({
                el:'mch-emulator',
                layout:'fit',
                width:800,
                height:540,
                listeners: { 
					          beforehide : __onResearchFixWindowHide, 
					          show : __onResearchFixWindowShow 
							},
                closeAction:'hide',
                plain: true,                
                items: new Ext.TabPanel({
                    el: 'mch-emulator-tabs',
                    id: 'mch_emulator_tabs_id',
                    autoTabs:true,
					enableTabScroll:true,
                    activeTab:0,
					deferredRender:false,
                    border:false
                })
            });
                        
            var tb = new Ext.Toolbar();
    		tb.render('mch-toolbar');

			//Get the Menu Items based on the Menu Id's
			var researchMenuItems = __getMenuItems(__CONST_RES_MENU_ID);
			var multiBasisResMenuItems = __getMenuItems(__CONST_MULT_BAS_MENU_ID);
			
			__multiBasisResearch = new Ext.menu.Menu({
														id: 'multiBasisMenu',
														items: multiBasisResMenuItems
													});
    		
    		__researchFixMenu = new Ext.menu.Menu({
														id: 'mainMenu',
														items: researchMenuItems
													});
    		
			var dateMenu = new Ext.menu.DateMenu();
			
		    tb.add({
		    		id: __CONST_RES_MENU_ID,
		            text:'Research',
		            iconCls: 'bmenu',  // <-- icon
		            menu: __researchFixMenu  // assign menu by instance
		        },
				{
		    		id: __CONST_MULT_BAS_MENU_ID,
		            text:'Multi Basis Browse',
		            iconCls: 'bmenu',  // <-- icon
		            menu: __multiBasisResearch  // assign menu by instance
		        },					
		        {
		        	id: 'calendar',
		        	text: 'Calendar',
		        	iconCls: 'calendar',
		        	menu: dateMenu
		        });
       	}
        return __researchFixWindow;
	}
	
	function __showWindow(tab)
	{
        var win = __getResearchFixWindow();
        win.show(); 
		win.findById("mch_emulator_tabs_id").items.first().disable();               		
	}

	function __showEmulator(func, vals)
	{	
        var win = __getResearchFixWindow();
        win.show();        		
		win.findById("mch_emulator_tabs_id").items.first().enable();
        
        divView.tab = win.getComponent(0).getComponent(0);

        divView.setPrefillValues(null);
        divView.gotoFunction('RGTC');

		if (typeof(vals) == "function")
		{
			divView.setHandler(vals);
		}
		else
	    {
			divView.setPrefillValues(vals);
		}
	        
        divView.gotoFunction(func);
        
        divView.tab.show();
        __emulatorActive = true;
	}
	
	function __onSubmitClick(aModuleName)
	{
		if(aModuleName == __CONST_BGMM)
		{	
			var inFund = Ext.getCmp("txtBgmmFund");
			var inCusip = 	Ext.getCmp("txtBgmmCusip");		
			
			if(inFund != null && !inFund.isValid())
			{
				return;
			}	
			__frmFndInput = inFund.getValue().toUpperCase().trim();

			if(inCusip != null && !inCusip.isValid())
			{
				return;
			}
			
			var params = "";
			
			params = "FUND="  + inFund.getValue().trim()
				   + "&CUSIP=" + inCusip.getValue().trim();
			
			__showResearch(__CONST_BGMM, params);
		
			__BGMM_formWindow.hide();
		}
		else if(aModuleName == __CONST_BGMM5)
		{
			var inFund = Ext.getCmp("txtBgmm5Fund");
			var inCusip = 	Ext.getCmp("txtBgmm5Cusip");
			var inClcBasis = Ext.getCmp("txtBgmm5ClcBasis");

			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();
			
			if(inClcBasis != null && !inClcBasis.isValid())
			{
				return;
			}

			var params = "";
			
			params = "FUND="  + inFund.getValue().toUpperCase().trim()
				  + "&ASSET_ID=" + inCusip.getValue().toUpperCase().trim()
				  + "&CLC_BASIS=" + inClcBasis.getValue().toUpperCase().trim();
					
			__showResearch(__CONST_BGMM5, params,null,null,true);			
				
			__BGMM5_formWindow.hide();
		}
		else if(aModuleName == __CONST_BCAR)
		{
			var inCusip =  Ext.getCmp("txtBcarCusip");
			if(inCusip != null && !inCusip.isValid())
			{
				return;
			}
			
			var params = 'CUSIP='+inCusip.getValue().trim();		
			__showResearch(__CONST_BCAR, params);
			
			__BCAR_formWindow.hide();
		}
		else if(aModuleName == __CONST_BTRD)
		{
			var inFund = Ext.getCmp("txtBtrdFund");
			var inCusip = Ext.getCmp("txtBtrdCusip");

			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();

			var params = 'FUND='  + inFund.getValue().trim()
					   + '&CUSIP=' + inCusip.getValue().trim();
			__showResearch(__CONST_BTRD, params);
			
			__BTRD_formWindow.hide();
		}
		else if(aModuleName == __CONST_CTDA)
		{
			var inFund = Ext.getCmp("txtCtdaFund");
			var inCusip = Ext.getCmp("txtCtdaCusip");
			
			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();
			
			var params = 'FUND=' + inFund.getValue().trim()
					   + '&CUSIP=' + inCusip.getValue().trim();

			__showResearch(__CONST_CTDA, params);
			
			__CTDA_formWindow.hide();
		}
		else if(aModuleName == __CONST_BGLM)
		{
			var inFund = Ext.getCmp("txtBglmFund");
			var inCusip = Ext.getCmp("txtBglmCusip");

			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();

			var params = 'FUND='  + inFund.getValue().trim()
					   + '&CUSIP=' + inCusip.getValue().trim();
			__showResearch(__CONST_BGLM, params);
			
			__BGLM_formWindow.hide();
		}
		else if(aModuleName == __CONST_BRFD)
		{
			var inFund = Ext.getCmp("txtBrfdFund");
			var inCusip = Ext.getCmp("txtBrfdCusip");
			var inClcBasis = Ext.getCmp("txtBrfdClcBasis");

			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();

			if(inClcBasis != null && !inClcBasis.isValid())
			{
				return;
			}

			var params = 'FUND='  + inFund.getValue().toUpperCase().trim()
					   + '&ASSET_ID=' + inCusip.getValue().toUpperCase().trim()
					   + '&CLC_BASIS='+ inClcBasis.getValue().toUpperCase().trim();

			__showResearch(__CONST_BRFD, params);
			
			__BRFD_formWindow.hide();
		}
		else if(aModuleName == __CONST_BRKP)
		{
			var inFund = Ext.getCmp("txtBrkpFund");
			var inCusip = Ext.getCmp("txtBrkpCusip");
			var inClcBasis = Ext.getCmp("txtBrkpClcBasis");

			if(inFund != null && !inFund.isValid())
			{
				return;
			}
			__frmFndInput = inFund.getValue().toUpperCase().trim();

			if(inCusip != null && !inCusip.isValid())
			{
				return;
			}

			if(inClcBasis != null && !inClcBasis.isValid())
			{
				return;
			}

			var params = 'FUND='  + inFund.getValue().toUpperCase().trim()
					   + '&ASSET_ID=' + inCusip.getValue().toUpperCase().trim()
					   + '&CLC_BASIS='+ inClcBasis.getValue().toUpperCase().trim();
			__showResearch(__CONST_BRKP, params);
			
			__BRKP_formWindow.hide();
		}	
	}

	function __onCancelClick(aModuleName)
	{
		if(aModuleName == __CONST_BGMM)
		{	
			__BGMM_formWindow.hide();
		}
		else if(aModuleName == __CONST_BGMM5)
		{
			__BGMM5_formWindow.hide();
		}
		else if(aModuleName == __CONST_BCAR)
		{
			__BCAR_formWindow.hide();
		}
		else if(aModuleName == __CONST_BTRD)
		{
			__BTRD_formWindow.hide();
		}
		else if(aModuleName == __CONST_CTDA)
		{
			__CTDA_formWindow.hide();
		}
		else if(aModuleName == __CONST_BGLM)
		{
			__BGLM_formWindow.hide();
		}
		else if(aModuleName == __CONST_BRFD)
		{
			__BRFD_formWindow.hide();
		}
		else if(aModuleName == __CONST_BRKP)
		{
			__BRKP_formWindow.hide();
		}		
	}

	//Method to initialize the parameters for the Input Window
	function __initDefParameters()
	{		 
		if(null != __initParams && __initParams.length > 0)
		{
			var pArr = __initParams.split('&');
			for(var i=0;i<pArr.length;i++)
			{
				var tempVal = pArr[i].toUpperCase();
				if(tempVal.indexOf("STATUS") >= 0)
				{
					var tempArr = tempVal.split("=");
					__defStatus = tempArr[1];					
				}	
				else if(tempVal.indexOf("CUSIP") >= 0)
				{
					var tempArr = tempVal.split("=");
					__defCusip = tempArr[1];					
				}
				else if(tempVal.indexOf("FUND") >= 0)
				{
					var tempArr = tempVal.split("=");
					__defFund = tempArr[1];					
				}
				else if(tempVal.indexOf("CLC_BASIS") >= 0)
				{
					var tempArr = tempVal.split("=");
					__defClcBasis = tempArr[1];					
				}
			}
		}		
	}	

	//Method for generating Input Form for BGMM for R4.1 
	function __BGMM_showForm()
	{
		if (__BGMM_formWindow == null)
		{
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}
			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbBgmmFund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtBgmmFund',					
					forceSelection:true,
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });

		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [cmbBgmmFund, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBgmmCusip',
					allowBlank:false,
					value:__defCusip,
					anchor: '100%'
		        }]
		    });

			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbBgmmFund
							               ,'FUND_ID',__defFund);	
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	

			stFund.load();
		
		    __BGMM_formWindow = new Ext.Window({
		        title: 'F.I./S.T. LOTS (BGMM)',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BGMM)}
		        },{
		            text: 'Cancel',
		            handler: function(){__onCancelClick(__CONST_BGMM)}
		        }]
		    });
		}
		
	    __BGMM_formWindow.show();	
    }

	//Method for generating input for BGMM for R5
	function __BGMM5_showForm()
	{
		if (__BGMM5_formWindow == null)
		{
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}
			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbBgmm5Fund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtBgmm5Fund',					
					forceSelection:true,
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });

			idfParams = "&FUND_ID=";

			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}

			xmlFilePath += '?__request=804605'
						+ '&__dotAsUnderscore=true'
						+ idfParams;

			recMapping = [{name: 'BASIS', mapping: '@CLC_BASIS'}];	
			var stCalcBasis = __createSimpleStore(xmlFilePath,recMapping); 			

			var cmbCalcBasis = new Ext.form.ComboBox({
		            fieldLabel: 'BASIS',
		            name: 'BASIS',
					id: 'txtBgmm5ClcBasis',					
					forceSelection:true,
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stCalcBasis,
					displayField:'BASIS'
			 });

		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [cmbBgmm5Fund, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBgmm5Cusip',
					//allowBlank:false,
					value:__defCusip,
					anchor: '100%'
		        }, cmbCalcBasis]
		    });

			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbBgmm5Fund
							               ,'FUND_ID',__defFund);	
						__onFundComboChange(cmbBgmm5Fund,stCalcBasis);
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	
			stCalcBasis.on("load",function(){ 
					try
					{
						__setDefComboValue(stCalcBasis,cmbCalcBasis
							               ,'BASIS',__defClcBasis);	
					}
					catch(e)
					{
						//alert("Exception on CalcBasis Load");
					}
				});

			//To Clear the previous Values in the Basis Combo
			stCalcBasis.on("beforeload",function(){ 
						try
						{
							var tempBasis = cmbCalcBasis.getValue();
							if(tempBasis != null && tempBasis != undefined)
							{
								cmbCalcBasis.clearValue();
							}
						}
						catch(e)
						{
							//alert("Exception on calc basis before load event");
						}
				});	

			//To reload the Basis Combo based on the Selected Fund	
			cmbBgmm5Fund.on("select",function(){ 
					__onFundComboChange(cmbBgmm5Fund,stCalcBasis);
				});		
			
			stFund.load();
		
		    __BGMM5_formWindow = new Ext.Window({
		        title: 'F.I./S.T. LOTS (BGMM)',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BGMM5)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BGMM5)}
		        }]
		    });
		}
		
	    __BGMM5_formWindow.show();	
    }

	//Method for generating input form for BCAR
	function __BCAR_showForm()
	{
		if (__BCAR_formWindow == null)
		{
		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [{
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					allowBlank:false,
					id: 'txtBcarCusip' ,
					value: __defCusip,
		            anchor: '100%'
		        }]
		    });
		
		    __BCAR_formWindow = new Ext.Window({
		        title: 'CORPORATE ACTION (BCAR)',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BCAR)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BCAR)}
		        }]
		    });
		}
		
	    __BCAR_formWindow.show();	
    }

	//Method for generating input form for BTRD
	function __BTRD_showForm()
	{
		if (__BTRD_formWindow == null)
		{
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}
			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbBtrdFund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtBtrdFund',					
					forceSelection:true,
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });

		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [
					cmbBtrdFund,{
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBtrdCusip',
					value: __defCusip,
		            anchor: '100%'
		        }]
		    });

			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbBtrdFund
							               ,'FUND_ID',__defFund);	
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	

			stFund.load();
		
		    __BTRD_formWindow = new Ext.Window({
		        title: 'SMAC OPEN/SETTLED TRADE (BTRD)',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BTRD)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BTRD)}
		        }]
		    });
		}
		
	    __BTRD_formWindow.show();	
    }

	//Method for generating input form for CTDA
	function __CTDA_showForm()
	{
		if (__CTDA_formWindow == null)
		{
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}
			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbCtdaFund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtCtdaFund',					
					forceSelection:true,
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });

		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [
					cmbCtdaFund, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtCtdaCusip',
					value: __defCusip,
		            anchor: '100%'
		        }]
		    });
		
			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbCtdaFund
							               ,'FUND_ID',__defFund);	
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	

			stFund.load();

		    __CTDA_formWindow = new Ext.Window({
		        title: 'CUSTODY ACTIVITY (CTDA)',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_CTDA)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_CTDA)}
		        }]
		    });
		}
		
	    __CTDA_formWindow.show();	
    }

	//Method for generating input form for BGLM
	function __BGLM_showForm()
	{
		if (__BGLM_formWindow == null)
		{
		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [{
		            fieldLabel: 'FUND',
		            name: 'FUND',
					id: 'txtBglmFund',
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					value: __defFund,
		            anchor: '100%'
		        }, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBglmCusip',
					value: __defCusip,
		            anchor: '100%'
		        }]
		    });
		
		    __BGLM_formWindow = new Ext.Window({
		        title: 'BGLM',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BGLM)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BGLM)}
		        }]
		    });
		}
		
	    __BGLM_formWindow.show();	
    }
	
	//Method for generating input form for BRFD
	function __BRFD_showForm()
	{
		if (__BRFD_formWindow == null)
		{			
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}
			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbBrfdFund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtBrfdFund',
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					forceSelection:true,
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });
			
			idfParams = "&FUND_ID=";
			
			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}

			xmlFilePath += '?__request=804605'
						+ '&__dotAsUnderscore=true'
						+ idfParams;

			recMapping = [{name: 'BASIS', mapping: '@CLC_BASIS'}];	
			var stCalcBasis = __createSimpleStore(xmlFilePath,recMapping); 			

			var cmbCalcBasis = new Ext.form.ComboBox({
		            fieldLabel: 'BASIS',
		            name: 'BASIS',
					id: 'txtBrfdClcBasis',					
					forceSelection:true,
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stCalcBasis,
					displayField:'BASIS'
			 });

			var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [		           
				cmbBrfdFund, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBrfdCusip',
					value: __defCusip,
					//allowBlank:false,
		            anchor: '100%'
		        }, 
				cmbCalcBasis
		       ]
		    });		
		
			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbBrfdFund
							               ,'FUND_ID',__defFund);	
						__onFundComboChange(cmbBrfdFund,stCalcBasis);
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	
			stCalcBasis.on("load",function(){ 
					try
					{
						__setDefComboValue(stCalcBasis,cmbCalcBasis
							               ,'BASIS',__defClcBasis);	
					}
					catch(e)
					{
						//alert("Exception on CalcBasis Load");
					}
				});

			//To Clear the previous Values in the Basis Combo
			stCalcBasis.on("beforeload",function(){ 
						try
						{
							var tempBasis = cmbCalcBasis.getValue();
							if(tempBasis != null && tempBasis != undefined)
							{
								cmbCalcBasis.clearValue();
							}
						}
						catch(e)
						{
							//alert("Exception on calc basis before load event");
						}
				});	

			//To reload the Basis Combo based on the Selected Fund	
			cmbBrfdFund.on("select",function(){ 
					__onFundComboChange(cmbBrfdFund,stCalcBasis);
				});		
			
			stFund.load();
		
			__BRFD_formWindow = new Ext.Window({
		        title: 'BRFD',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BRFD)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BRFD)}
		        }]
		    });
		}
		
	    __BRFD_formWindow.show();	
    }

	//Method to generate input form for BRKP
	function __BRKP_showForm()
	{
		if (__BRKP_formWindow == null)
		{
			var xmlFilePath = "";
			var idfParams = "";
			var recMapping;			

			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}

			xmlFilePath += '?__request=804603'
						+ '&__dotAsUnderscore=true'
						+ idfParams;
			recMapping = [{name: 'FUND_ID', mapping: '@FUND_ID'}];	
			var stFund = __createSimpleStore(xmlFilePath,recMapping);

			var cmbBrkpFund = new Ext.form.ComboBox({
		            fieldLabel: 'FUND',
		            name: 'FUND_ID',
					id: 'txtBrkpFund',					
					forceSelection:true,
					regex: /^[A-Za-z0-9]{4}$/,
					regexText: 'Invalid Fund',
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stFund,
					displayField:'FUND_ID'
			 });

			 idfParams = "&FUND_ID=";

			if(null != __baseUrl && __baseUrl != undefined)
			{
				xmlFilePath = __baseUrl;
			}

			xmlFilePath += '?__request=804605'
						+ '&__dotAsUnderscore=true'
						+ idfParams;

			recMapping = [{name: 'BASIS', mapping: '@CLC_BASIS'}];	
			var stCalcBasis = __createSimpleStore(xmlFilePath,recMapping); 			

			var cmbCalcBasis = new Ext.form.ComboBox({
		            fieldLabel: 'BASIS',
		            name: 'BASIS',
					id: 'txtBrkpClcBasis',					
					forceSelection:true,
					allowBlank:false,
					triggerAction: 'all',
					anchor: '100%',
					mode: 'local',
					store:stCalcBasis,
					displayField:'BASIS'
			 });

		    var form = new Ext.form.FormPanel({
		        baseCls: 'x-plain',
		        labelWidth: 55,
				monitorValid: true,
		        defaultType: 'textfield',
		
		        items: [cmbBrkpFund, {
		            fieldLabel: 'CUSIP',
		            name: 'CUSIP',
					id: 'txtBrkpCusip',
					allowBlank:false,
					value: __defCusip,
		            anchor: '100%'
		        }, cmbCalcBasis]
		    });
		
			//For Setting default value to the Combo					
			stFund.on("load",function(){ 
					try
					{
						__setDefComboValue(stFund,cmbBrkpFund
							               ,'FUND_ID',__defFund);	
						__onFundComboChange(cmbBrkpFund,stCalcBasis);
					}
					catch(e)
					{
						//alert("Exception on fund load");
					}
				});	
			stCalcBasis.on("load",function(){ 
					try
					{
						__setDefComboValue(stCalcBasis,cmbCalcBasis
							               ,'BASIS',__defClcBasis);	
					}
					catch(e)
					{
						//alert("Exception on CalcBasis Load");
					}
				});

			//To Clear the previous Values in the Basis Combo
			stCalcBasis.on("beforeload",function(){ 
						try
						{
							var tempBasis = cmbCalcBasis.getValue();
							if(tempBasis != null && tempBasis != undefined)
							{
								cmbCalcBasis.clearValue();
							}
						}
						catch(e)
						{
							//alert("Exception on calc basis before load event");
						}
				});	

			//To reload the Basis Combo based on the Selected Fund	
			cmbBrkpFund.on("select",function(){ 
					__onFundComboChange(cmbBrkpFund,stCalcBasis);
				});		
			
			stFund.load();			

		    __BRKP_formWindow = new Ext.Window({
		        title: 'BRKP',
		        width: 300,
		        height:200,
		        minWidth: 300,
		        minHeight: 100,
		        layout: 'fit',
		        plain:true,
		        bodyStyle:'padding:5px;',
		        buttonAlign:'center',
		        items: form,
		
		        buttons: [{
		            text: 'Submit',
		            handler: function(){__onSubmitClick(__CONST_BRKP)}
		        },{
		            text: 'Cancel',
		            handler:  function(){__onCancelClick(__CONST_BRKP)}
		        }]
		    });
		}
		
	    __BRKP_formWindow.show();	
    }
	
	function __fmtExpValue(value)
	{
		if(value != null && value.trim() != "" 
		&& !isNaN(parseFloat(value)) && value.indexOf("E") >= 0)
		{
			return(parseFloat(value).toPrecision(10));
		}
		else
		{
			return value;
		}		
	}

	//Method to truncate the leading and trailing zeroes for a float value
	function __fmtDoubleValue(value)
	{
		var fmDblValue = "0.0";
		if(value != null && value.trim() != "" && !isNaN(parseFloat(value)))
		{
			if(parseFloat(value) != 0)
			{
				fmDblValue = parseFloat(value)+"";
				if(fmDblValue.indexOf(".") == -1)
				{
					fmDblValue += ".0";
				}
			}
		}
		return fmDblValue;
	}
	
	//Method to format date in mm/dd/yyyy format
	function __formatDate(value)
	{
		if(value == null || value == ' ')
		{
			value = "";
		}
		else
		{
			value = Ext.util.Format.date(value,'m/d/Y');
		}
		return value;
	}
	
	//Method to Format the YYYYMMDD to MM/DD/YYYY format
	function __fmtDateString(value)
	{
		var fmDateVal = "";
		var mmVal = "";
		var ddVal = "";
		var yyVal = "";
	
		if(value != null && value.length == 8 && !isNaN(parseInt(value,10)) 
			&& parseInt(value,10) != 0 && value != "99999999")
		{
			mm = value.substring(4,6);
			dd = value.substring(6,8);
			yy = value.substring(0,4);
			
			fmDateVal = mm+"/"+dd+"/"+yy;
			if(!__validateUSDate(fmDateVal))
			{
				fmDateVal = "";
			}		
		}
		return fmDateVal;
	}
	
	//Method to validate the MM/DD/YYYY format dates
	function __validateUSDate(strValue) 
	{	
		var objRegExp = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/
	 
		//check to see if in correct format
		if(!objRegExp.test(strValue))
		{
			return false; //doesn't match pattern, bad date
		}
		else
		{
			var strSeparator = strValue.substring(2,3) 
			var arrayDate = strValue.split(strSeparator); 
			//create a lookup for months not equal to Feb.
			var arrayLookup = { '01' : 31,'03' : 31, 
								'04' : 30,'05' : 31,
								'06' : 30,'07' : 31,
								'08' : 31,'09' : 30,
								'10' : 31,'11' : 30,'12' : 31}
		    var intDay = parseInt(arrayDate[1],10); 
	
			//check if month value and day value agree
			if(arrayLookup[arrayDate[0]] != null) 
			{
				if(intDay <= arrayLookup[arrayDate[0]] && intDay != 0)
					return true; //found in lookup table, good date
			}
	    
			var intMonth = parseInt(arrayDate[0],10);
			if (intMonth == 2) 
			{ 
				var intYear = parseInt(arrayDate[2],10);
				if (intDay > 0 && intDay < 29) 
				{
					return true;
				}
				else if (intDay == 29) 
				{
					if ((intYear % 4 == 0) && (intYear % 100 != 0) || (intYear % 400 == 0)) 
					{
						// year div by 4 and ((not div by 100) or div by 400) ->ok
						return true;
					}   
				}
			}
		}  
		return false; //any other values, bad date
	}
	
	//Method to create Group By Store
	function __createGroupByStore(xmlFilePath,aRecMapping,aSortInfo,aGroupField)
	{
		var store = new Ext.data.GroupingStore(
		{
			url: xmlFilePath,
			
			reader: new Ext.data.XmlReader(
			{
				record: 'row'
			}, 
			aRecMapping),
			groupField: aGroupField,
			sortInfo: aSortInfo
		});
	
		return store;
	}

	//Method to create simple store for the combos
	function __createSimpleStore(xmlFilePath,aRecMapping)
	{
		var store = new Ext.data.Store(
		{
			url: xmlFilePath,
			
			reader: new Ext.data.XmlReader(
			{
				record: 'row'
			}, 
			aRecMapping),
			autoLoad:true 
		});
		
		return store;
	}

	//Method to set default value to the combo	
	function __setDefComboValue(aStoreObj,aCmbObj,aFieldVal,aDefValue)
	{		
		if(aStoreObj.getTotalCount() > 0 && aDefValue != null 
			&& aDefValue != undefined && aDefValue != "")
		{
			aStoreObj.each(function(r) 
			{
				if(r.get(aFieldVal) == aDefValue)
				{
					aCmbObj.setValue(aDefValue);
					return;
				}					
			});
		}	
	}

	function __onFundComboChange(aSelComboObj,aStResetCmbObj)
	{
		if(aSelComboObj != null && aSelComboObj != undefined)
		{
			//aResetCmb.clearValue();
			var fndVal = aSelComboObj.getValue() + "";
			aStResetCmbObj.reload({
									params: {
												FUND_ID: fndVal,
												__request:'804605',
												__dotAsUnderscore:'true'
											}
								});
		}
	}
	
	//Method to get the store object based on the browse module
	function __getDsStore(argModule,argParams, baseUrl)
	{
		var xmlFilePath = "";
		var recMapping;
		var sortFieldInfo;
		var groupFieldInfo;
		var store = null;
		var idfParams = "";
	
		if(argParams != undefined)
		{
			idfParams = "&" + argParams;
		}
		
		if(null != baseUrl && baseUrl != undefined)
		{
			xmlFilePath += baseUrl;
		}
		
		if(argModule == __CONST_BGMM)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=GPG1&ASSET_ID=00037EAC0&CLC_BASIS=IFRS";
			}
	
			//If Basis present call 807076 else call 510022
			if(idfParams.indexOf('CLC_BASIS') >= 0) 
			{
				xmlFilePath += '?__request=807076'
						+ '&__dotAsUnderscore=true'
						+ idfParams;	
			}
			else
			{
				xmlFilePath += '?__request=510022'
						+ '&__dotAsUnderscore=true'
						+ '&__fields=GMM.FREQ_CODE,GMM.CUSIP,GMM.PA_LOT,GMM.ACCOUNT,'
						+ 'GMM.ISSUE_CLASS,GMM.MAT_DATE,GMM.COUPON,'
						+ 'GMM.VAR_RATE,GMM.ODD_COUP,'
						+ 'GMM.STATE_CODE,GMM.COUNTRY_CODE,GMM.DAYS_MAT,'
						+ 'GMM.INCOM_DAYS,GMM.BASIS_IND,'
						+ 'GMM.UPD_PROGRAM_ID,GMM.DATE_UPDATED,GMM.ICRS_USER,'
						+ 'ICRS_DATE,GMM.ISSUE_DATE,'
						+ 'GMM.INCOM_DAT1,GMM.INCOM_DAT2,GMM.CALC_PUR_INT,'
						+ 'GMM.TAX_STATUS,GMM.DEFERRAL,'
						+ 'GMM.ACRU,GMM.ACRU_TAXES,GMM.VAR_RATE_FREQ,'
						+ 'GMM.RATE_CHANGE_DATE'
						+ idfParams;
			}
			
			recMapping = [
							{
								name: 'FUND', 
								mapping: '@GMM_FUND'
							},
							{
								name: 'FREQ_CODE', 
								mapping: '@GMM_FREQ_CODE'
							},
							{
								name: 'CUSIP', 
								mapping: '@GMM_CUSIP'
							},
							{
								name: 'PA_LOT', 
								mapping: '@GMM_PA_LOT'
							},
							{
								name: 'ACCOUNT', 
								mapping: '@GMM_ACCOUNT'
							},
							{
								name: 'ISSUE_ACCOUNT_NO', 
								mapping: '@GMM_ISSUE_ACCT_NUM'
							},
							{
								name: 'ISSUE_CLASS', 
								mapping: '@GMM_ISSUE_CLASS'
							},
							{
								name: 'MAT_DATE', 
								mapping: '@GMM_MAT_DATE', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'COUPON', 
								mapping: '@GMM_COUPON'
							},
							{
								name: 'VAR_RATE', 
								mapping: '@GMM_VAR_RATE'
							},
							{
								name: 'ODD_COUP', 
								mapping: '@GMM_ODD_COUP'
							},
							{
								name: 'STATE_CODE', 
								mapping: '@GMM_STATE_CODE'
							},
							{
								name: 'COUNTRY_CODE', 
								mapping: '@GMM_COUNTRY_CODE'
							},
							{
								name: 'DAYS_MAT', 
								mapping: '@GMM_DAYS_MAT'
							},
							{
								name: 'INCOM_DAYS', 
								mapping: '@GMM_INCOM_DAYS'
							},
							{
								name: 'BASIS_IND', 
								mapping: '@GMM_BASIS_IND'
							},
							{
								name: 'UPD_PROGRAM_ID', 
								mapping: '@GMM_UPD_PROGRAM_ID'
							},
							{
								name: 'DATE_UPDATED', 
								mapping: '@GMM_DATE_UPDATED', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'ICRS_USER', 
								mapping: '@GMM_ICRS_USER'
							},
							{
								name: 'ICRS_DATE', 
								mapping: '@GMM_ICRS_DATE'
							},
							{
								name: 'ISSUE_DATE', 
								mapping: '@GMM_ISSUE_DATE', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'INCOM_DAT1', 
								mapping: '@GMM_INCOM_DAT1'
							},
							{
								name: 'INCOM_DAT2', 
								mapping: '@GMM_INCOM_DAT2'
							},
							{
								name: 'CALC_PUR_INT', 
								mapping: '@GMM_CALC_PUR_INT'
							},
							{
								name: 'TAX_STATUS', 
								mapping: '@GMM_TAX_STATUS'
							},
							{
								name: 'DEFERRAL', 
								mapping: '@GMM_DEFERRAL'
							},
							{
								name: 'ACRU', 
								mapping: '@GMM_ACRU'
							},
							{
								name: 'ACRU_TAX', 
								mapping: '@GMM_ACRU_TAX'
							},
							{
								name: 'VAR_RATE_FREQ ', 
								mapping: '@GMM_VAR_RATE_FREQ '
							},
							{
								name: 'VAR_RATE_CHANGE_DATE', 
								mapping: '@GMM_VAR_RATE_CHANGE_DATE'
							}
						];
	
			sortFieldInfo = {field: 'CUSIP', direction: "ASC"};
			groupFieldInfo = 'PA_LOT';
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
	
		}	
		if(argModule == __CONST_BGMM5)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=NULL&ASSET_ID=NULLINPUTS&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807076'
					+ '&__dotAsUnderscore=true'
					+ idfParams;	
			
			// 76 columns 
			
			recMapping = [
							{
								name: 'GMM_FUND_ID', 
								mapping: '@GMM_FUND_ID'
							},										
							// 1st 25 start here.      
							{
								name: 'GMM_ESM_ISSUE_ID', 
								mapping: '@GMM_ESM_ISSUE_ID'
							},                                    
							{
								name: 'GMM_CLC_BASIS_CD', 
								mapping: '@GMM_CLC_BASIS_CD'
							},   						// For Joanna
							{
								name: 'GMM_BUY_DT', 
								mapping: '@GMM_BUY_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                          
							{
								name: 'GMM_LOT_NUM', 
								mapping: '@GMM_LOT_NUM'
							},                                         
							{
								name: 'GMM_ACCOUNT_NUM', 
								mapping: '@GMM_ACCOUNT_NUM'
							},                                     
							{
								name: 'GMM_MTRTY_DT', 
								mapping: '@GMM_MTRTY_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_COUPON_RT', 
								mapping: '@GMM_COUPON_RT'
							},                                       
							{
								name: 'GMM_CURR_CD', 
								mapping: '@GMM_CURR_CD'
							},                                         
							{
								name: 'GMM_XCHG_RT', 
								mapping: '@GMM_XCHG_RT'
							},
							// Available on Taxlot-Fin
							{
								name: 'GMM_BUY_CD', 
								mapping: '@GMM_BUY_CD'
							},	                                          
							{
								name: 'GMM_RESTRICT_FLG', 
								mapping: '@GMM_RESTRICT_FLG'
							},                                   
							{
								name: 'GMM_LONG_SHORT_CD', 
								mapping: '@GMM_LONG_SHORT_CD'
							},                                   
							{
								name: 'GMM_REPT_CLS_CD', 
								mapping: '@GMM_REPT_CLS_CD'
							},                                     
							{
								name: 'GMM_ODD_CPN_FLG', 
								mapping: '@GMM_ODD_CPN_FLG'
							},                                     
							{
								name: 'GMM_GOVT_IND_FLG', 
								mapping: '@GMM_GOVT_IND_FLG'
							},                                    
							{
								name: 'GMM_STATE_CD', 
								mapping: '@GMM_STATE_CD'
							},                                       
							{
								name: 'GMM_PAR_SHR_NUM', 
								mapping: '@GMM_PAR_SHR_NUM'
							},
							// Available on Taxlot-Fin
							{
								name: 'GMM_FACE_AMT', 
								mapping: '@GMM_FACE_AMT'
							},                                        
							{
								name: 'GMM_CLTRL_PAR_AMT', 
								mapping: '@GMM_CLTRL_PAR_AMT'
							},                                   
							{
								name: 'GMM_ISSUE_DT', 
								mapping: '@GMM_ISSUE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_SETTLE_DT', 
								mapping: '@GMM_SETTLE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                       
							{
								name: 'GMM_REVERSE_REPO_FLG', 
								mapping: '@GMM_REVERSE_REPO_FLG'
							},                                
							{
								name: 'GMM_REPO_CD', 
								mapping: '@GMM_REPO_CD'
							},                                         
							{
								name: 'GMM_TAX_STATUS_CD', 
								mapping: '@GMM_TAX_STATUS_CD'
							},                                   
							{
								name: 'GMM_AMORT_IND_CD', 
								mapping: '@GMM_AMORT_IND_CD'
							},							
							// 25 End Here             
							{
								name: 'GMM_ISSUE_ACCT_NUM', 
								mapping: '@GMM_ISSUE_ACCT_NUM'
							},  						
							// For Joanna
							{
								name: 'GMM_ACCRUE_STOP_CD', 
								mapping: '@GMM_ACCRUE_STOP_CD'
							},						
							// 33 Start here           
							{
								name: 'GMM_ACCRUE_DT', 
								mapping: '@GMM_ACCRUE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                       
							{
								name: 'GMM_ACCRUAL_XCHG_RT', 
								mapping: '@GMM_ACCRUAL_XCHG_RT'
							},                                 
							{
								name: 'GMM_ACCRUAL_XCHG_DT', 
								mapping: '@GMM_ACCRUAL_XCHG_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                 
							{
								name: 'GMM_DAYS_SPENT_AMR_NUM', 
								mapping: '@GMM_DAYS_SPENT_AMR_NUM'
							},                              
							{
								name: 'GMM_TOT_ACR_AMT', 
								mapping: '@GMM_TOT_ACR_AMT'
							},                                     
							{
								name: 'GMM_ACCR_FACT_AMT', 
								mapping: '@GMM_ACCR_FACT_AMT'
							},                                   
							{
								name: 'GMM_ACCR_ADJ_AMT', 
								mapping: '@GMM_ACCR_ADJ_AMT'
							},                                    
							{
								name: 'GMM_ACCRUED_TOT_AMT', 
								mapping: '@GMM_ACCRUED_TOT_AMT'
							},                                 
							{
								name: 'GMM_ACR_INT_TX_EXP_AMT', 
								mapping: '@GMM_ACR_INT_TX_EXP_AMT'
							},                              
							{
								name: 'GMM_ACR_INT_TX_REF_AMT', 
								mapping: '@GMM_ACR_INT_TX_REF_AMT'
							},                              
							{
								name: 'GMM_ACR_CRNT_AMT', 
								mapping: '@GMM_ACR_CRNT_AMT'
							},                                    
							{
								name: 'GMM_INT_CURR_GL_AMT', 
								mapping: '@GMM_INT_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_ACR_PRIOR_AMT', 
								mapping: '@GMM_ACR_PRIOR_AMT'
							},                                   
							{
								name: 'GMM_TAX_CURR_GL_AMT', 
								mapping: '@GMM_TAX_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_ACRE_TAXES_FLG', 
								mapping: '@GMM_ACRE_TAXES_FLG'
							},                                  
							{
								name: 'GMM_ACRE_ACT_MTHD_CD', 
								mapping: '@GMM_ACRE_ACT_MTHD_CD'
							},                                
							{
								name: 'GMM_ACRE_RULE_CD', 
								mapping: '@GMM_ACRE_RULE_CD'
							},                                    
							{
								name: 'GMM_AMRTN_FLG', 
								mapping: '@GMM_AMRTN_FLG'
							},                                       
							{
								name: 'GMM_LAST_AMORT_DT', 
								mapping: '@GMM_LAST_AMORT_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_AMRTN_TYPE_CD', 
								mapping: '@GMM_AMRTN_TYPE_CD'
							},                                   
							{
								name: 'GMM_AMRTN_OPTION_CD', 
								mapping: '@GMM_AMRTN_OPTION_CD'
							},                                 
							{
								name: 'GMM_MKT_AMRTN_FLG', 
								mapping: '@GMM_MKT_AMRTN_FLG'
							},                                   
							{
								name: 'GMM_OI_AMRTN_FLG', 
								mapping: '@GMM_OI_AMRTN_FLG'
							},                                    
							{
								name: 'GMM_P_OR_D_OI_FLG', 
								mapping: '@GMM_P_OR_D_OI_FLG'
							},                                   
							{
								name: 'GMM_AMRTZ_XCHG_RT', 
								mapping: '@GMM_AMRTZ_XCHG_RT'
							},                                   
							{
								name: 'GMM_AMR_XCHG_DT', 
								mapping: '@GMM_AMR_XCHG_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_AVG_TOT_AMRTZ_AMT', 
								mapping: '@GMM_AVG_TOT_AMRTZ_AMT'
							},                               
							{
								name: 'GMM_AMR_CURR_GL_AMT', 
								mapping: '@GMM_AMR_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_AMR_TAX_EXP_AMT', 
								mapping: '@GMM_AMR_TAX_EXP_AMT'
							},                                 
							{
								name: 'GMM_AMR_TAX_REF_AMT', 
								mapping: '@GMM_AMR_TAX_REF_AMT'
							},                                 
							{
								name: 'GMM_AMR_PRIOR_AMT', 
								mapping: '@GMM_AMR_PRIOR_AMT'
							},
							// 33 End here
							{
								name: 'GMM_AMR_CNT', 
								mapping: '@GMM_AMR_CNT'
							},
							// 16 start here.  
							{
								name: 'GMM_AMR_ADJ_CD', 
								mapping: '@GMM_AMR_ADJ_CD'
							},
							{
								name: 'GMM_AMR_TAX_WTHLD_FLG', 
								mapping: '@GMM_AMR_TAX_WTHLD_FLG'
							},                              
							{
								name: 'GMM_AMR_ACT_MTHD_CD', 
								mapping: '@GMM_AMR_ACT_MTHD_CD'
							},
							{
								name: 'GMM_AMR_RULE_CD', 
								mapping: '@GMM_AMR_RULE_CD'
							},        
							{
								name: 'GMM_AMR_FRACTION_NUM', 
								mapping: '@GMM_AMR_FRACTION_NUM'
							},                                
							{
								name: 'GMM_SUSPEND_AMRTN_FLG ', 
								mapping: '@GMM_SUSPEND_AMRTN_FLG'
							},                              
							{
								name: 'GMM_ABS_DISC_PMM_CD', 
								mapping: '@GMM_ABS_DISC_PMM_CD'
							},                                 
							{
								name: 'GMM_ABS_PP_DISC_PMM_CD ', 
								mapping: '@GMM_ABS_PP_DISC_PMM_CD'
							},                             
							{
								name: 'GMM_ABS_ME_DISC_PMM_CD', 
								mapping: '@GMM_ABS_ME_DISC_PMM_CD'
							},                              
							{
								name: 'GMM_MUNI_MKT_AMR_CD', 
								mapping: '@GMM_MUNI_MKT_AMR_CD'
							},                                 
							{
								name: 'GMM_TOT_INT_ADJ_AMT', 
								mapping: '@GMM_TOT_INT_ADJ_AMT'
							},                                 
							{
								name: 'GMM_TAX_RCL_ADJ_AMT ', 
								mapping: '@GMM_TAX_RCL_ADJ_AMT'
							},                                
							{
								name: 'GMM_TAX_WTHLD_ADJ_AMT', 
								mapping: '@GMM_TAX_WTHLD_ADJ_AMT'
							},                               
							{
								name: 'GMM_INT_CUR_GL_ADJ_AMT', 
								mapping: '@GMM_INT_CUR_GL_ADJ_AMT'
							},                              
							{
								name: 'GMM_TAX_EXP_GL_ADJ_AMT', 
								mapping: '@GMM_TAX_EXP_GL_ADJ_AMT'
							}
							// 16 end here. 
						];
							
			sortFieldInfo = {field: 'GMM_ESM_ISSUE_ID', direction: "ASC"};
			groupFieldInfo = 'GMM_LOT_NUM';
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
	
		}			
		if(argModule == __CONST_MULT_LOT_DET)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=NULL&ASSET_ID=NULLINPUTS&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807076'
					+ '&__dotAsUnderscore=true'
					+ idfParams;	
			
			// First 26 out of 76 columns 
			
			recMapping = [
							{
								name: 'GMM_FUND_ID', 
								mapping: '@GMM_FUND_ID'
							},
							// 1st 25 start here.      
							{
								name: 'GMM_ESM_ISSUE_ID', 
								mapping: '@GMM_ESM_ISSUE_ID'
							},                                    
							{
								name: 'GMM_CLC_BASIS_CD', 
								mapping: '@GMM_CLC_BASIS_CD'
							},
							// For Joanna
							{
								name: 'GMM_BUY_DT', 
								mapping: '@GMM_BUY_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                          
							{
								name: 'GMM_LOT_NUM', 
								mapping: '@GMM_LOT_NUM'
							},                                         
							{
								name: 'GMM_ACCOUNT_NUM', 
								mapping: '@GMM_ACCOUNT_NUM'
							},                                     
							{
								name: 'GMM_MTRTY_DT', 
								mapping: '@GMM_MTRTY_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_COUPON_RT', 
								mapping: '@GMM_COUPON_RT'
							},                                       
							{
								name: 'GMM_CURR_CD', 
								mapping: '@GMM_CURR_CD'
							},                                         
							{
								name: 'GMM_XCHG_RT', 
								mapping: '@GMM_XCHG_RT'
							},
							// Available on Taxlot-Fin
							{
								name: 'GMM_BUY_CD', 
								mapping: '@GMM_BUY_CD'
							},	                                          
							{
								name: 'GMM_RESTRICT_FLG', 
								mapping: '@GMM_RESTRICT_FLG'
							},                                   
							{
								name: 'GMM_LONG_SHORT_CD', 
								mapping: '@GMM_LONG_SHORT_CD'
							},                                   
							{
								name: 'GMM_REPT_CLS_CD', 
								mapping: '@GMM_REPT_CLS_CD'
							},                                     
							{
								name: 'GMM_ODD_CPN_FLG', 
								mapping: '@GMM_ODD_CPN_FLG'
							},                                     
							{
								name: 'GMM_GOVT_IND_FLG', 
								mapping: '@GMM_GOVT_IND_FLG'
							},                                    
							{
								name: 'GMM_STATE_CD', 
								mapping: '@GMM_STATE_CD'
							},                                       
							{
								name: 'GMM_PAR_SHR_NUM', 
								mapping: '@GMM_PAR_SHR_NUM'
							},
							// Available on Taxlot-Fin
							{
								name: 'GMM_FACE_AMT', 
								mapping: '@GMM_FACE_AMT'
							},                                        
							{
								name: 'GMM_CLTRL_PAR_AMT', 
								mapping: '@GMM_CLTRL_PAR_AMT'
							},                                   
							{
								name: 'GMM_ISSUE_DT', 
								mapping: '@GMM_ISSUE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_SETTLE_DT', 
								mapping: '@GMM_SETTLE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                       
							{
								name: 'GMM_REVERSE_REPO_FLG', 
								mapping: '@GMM_REVERSE_REPO_FLG'
							},                                
							{
								name: 'GMM_REPO_CD', 
								mapping: '@GMM_REPO_CD'
							},                                         
							{
								name: 'GMM_TAX_STATUS_CD', 
								mapping: '@GMM_TAX_STATUS_CD'
							},                                   
							{
								name: 'GMM_AMORT_IND_CD', 
								mapping: '@GMM_AMORT_IND_CD'
							},
							// 25 End Here             
							{
								name: 'GMM_ISSUE_ACCT_NUM', 
								mapping: '@GMM_ISSUE_ACCT_NUM'
							} 
							// For Joanna							
						];
							
			sortFieldInfo = {field: 'GMM_ESM_ISSUE_ID', direction: "ASC"};
			groupFieldInfo = 'GMM_LOT_NUM';
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
	
		}	
		if(argModule == __CONST_LOT_WITH_DET)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=NULL&ASSET_ID=NULLINPUTS&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807076'
					+ '&__dotAsUnderscore=true'
					+ idfParams;	
			
			// Next (around) 33 out of 76 columns 
			
			recMapping = [
							{
								name: 'GMM_FUND_ID', 
								mapping: '@GMM_FUND_ID'
							},
							// 1st 25 start here.      
							{
								name: 'GMM_ESM_ISSUE_ID', 
								mapping: '@GMM_ESM_ISSUE_ID'
							},                                    
							{
								name: 'GMM_CLC_BASIS_CD', 
								mapping: '@GMM_CLC_BASIS_CD'
							},  
							// For Joanna
							{
								name: 'GMM_LOT_NUM', 
								mapping: '@GMM_LOT_NUM'
							},
							// for group by
							{
								name: 'GMM_ACCRUE_STOP_CD', 
								mapping: '@GMM_ACCRUE_STOP_CD'
							},						
							// 33 Start here           
							{
								name: 'GMM_ACCRUE_DT', 
								mapping: '@GMM_ACCRUE_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                       
							{
								name: 'GMM_ACCRUAL_XCHG_RT', 
								mapping: '@GMM_ACCRUAL_XCHG_RT'
							},                                 
							{
								name: 'GMM_ACCRUAL_XCHG_DT', 
								mapping: '@GMM_ACCRUAL_XCHG_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},                                 
							{
								name: 'GMM_DAYS_SPENT_AMR_NUM', 
								mapping: '@GMM_DAYS_SPENT_AMR_NUM'
							},                              
							{
								name: 'GMM_TOT_ACR_AMT', 
								mapping: '@GMM_TOT_ACR_AMT'
							},                                     
							{
								name: 'GMM_ACCR_FACT_AMT', 
								mapping: '@GMM_ACCR_FACT_AMT'
							},                                   
							{
								name: 'GMM_ACCR_ADJ_AMT', 
								mapping: '@GMM_ACCR_ADJ_AMT'
							},                                    
							{
								name: 'GMM_ACCRUED_TOT_AMT', 
								mapping: '@GMM_ACCRUED_TOT_AMT'
							},                                 
							{
								name: 'GMM_ACR_INT_TX_EXP_AMT', 
								mapping: '@GMM_ACR_INT_TX_EXP_AMT'
							},                              
							{
								name: 'GMM_ACR_INT_TX_REF_AMT', 
								mapping: '@GMM_ACR_INT_TX_REF_AMT'
							},                              
							{
								name: 'GMM_ACR_CRNT_AMT', 
								mapping: '@GMM_ACR_CRNT_AMT'
							},                                    
							{
								name: 'GMM_INT_CURR_GL_AMT', 
								mapping: '@GMM_INT_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_ACR_PRIOR_AMT', 
								mapping: '@GMM_ACR_PRIOR_AMT'
							},                                   
							{
								name: 'GMM_TAX_CURR_GL_AMT', 
								mapping: '@GMM_TAX_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_ACRE_TAXES_FLG', 
								mapping: '@GMM_ACRE_TAXES_FLG'
							},                                  
							{
								name: 'GMM_ACRE_ACT_MTHD_CD', 
								mapping: '@GMM_ACRE_ACT_MTHD_CD'
							},                                
							{
								name: 'GMM_ACRE_RULE_CD', 
								mapping: '@GMM_ACRE_RULE_CD'
							},                                    
							{
								name: 'GMM_AMRTN_FLG', 
								mapping: '@GMM_AMRTN_FLG'
							},                                       
							{
								name: 'GMM_LAST_AMORT_DT', 
								mapping: '@GMM_LAST_AMORT_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_AMRTN_TYPE_CD', 
								mapping: '@GMM_AMRTN_TYPE_CD'
							},                                   
							{
								name: 'GMM_AMRTN_OPTION_CD', 
								mapping: '@GMM_AMRTN_OPTION_CD'
							},                                 
							{
								name: 'GMM_MKT_AMRTN_FLG', 
								mapping: '@GMM_MKT_AMRTN_FLG'
							},                                   
							{
								name: 'GMM_OI_AMRTN_FLG', 
								mapping: '@GMM_OI_AMRTN_FLG'
							},                                    
							{
								name: 'GMM_P_OR_D_OI_FLG', 
								mapping: '@GMM_P_OR_D_OI_FLG'
							},                                   
							{
								name: 'GMM_AMRTZ_XCHG_RT', 
								mapping: '@GMM_AMRTZ_XCHG_RT'
							},                                   
							{
								name: 'GMM_AMR_XCHG_DT', 
								mapping: '@GMM_AMR_XCHG_DT', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name: 'GMM_AVG_TOT_AMRTZ_AMT', 
								mapping: '@GMM_AVG_TOT_AMRTZ_AMT'
							},                               
							{
								name: 'GMM_AMR_CURR_GL_AMT', 
								mapping: '@GMM_AMR_CURR_GL_AMT'
							},                                 
							{
								name: 'GMM_AMR_TAX_EXP_AMT', 
								mapping: '@GMM_AMR_TAX_EXP_AMT'
							},                                 
							{
								name: 'GMM_AMR_TAX_REF_AMT', 
								mapping: '@GMM_AMR_TAX_REF_AMT'
							},                                 
							{
								name: 'GMM_AMR_PRIOR_AMT', 
								mapping: '@GMM_AMR_PRIOR_AMT'
							}								
							// 33 End here    
						];
							
			sortFieldInfo = {field: 'GMM_ESM_ISSUE_ID', direction: "ASC"};
			groupFieldInfo = 'GMM_LOT_NUM';
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
	
		}	
		if(argModule == __CONST_LOT_ADJ_DET)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=NULL&ASSET_ID=NULLINPUTS&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807076'
					+ '&__dotAsUnderscore=true'
					+ idfParams;	
			
			// Last (around)16 out of 76 columns 
			
			recMapping = [
							{
								name: 'GMM_FUND_ID', 
								mapping: '@GMM_FUND_ID'
							},
							// 1st 25 start here.      
							{
								name: 'GMM_ESM_ISSUE_ID', 
								mapping: '@GMM_ESM_ISSUE_ID'
							},                                    
							{
								name: 'GMM_CLC_BASIS_CD', 
								mapping: '@GMM_CLC_BASIS_CD'
							},   			
							// For Joanna
							{
								name: 'GMM_LOT_NUM', 
								mapping: '@GMM_LOT_NUM'
							},
							// for group by							
							{
								name: 'GMM_AMR_CNT', 
								mapping: '@GMM_AMR_CNT'
							},
							// 16 start here.  
							{
								name: 'GMM_AMR_ADJ_CD', 
								mapping: '@GMM_AMR_ADJ_CD'
							},                                      
							{
								name: 'GMM_AMR_TAX_WTHLD_FLG', 
								mapping: '@GMM_AMR_TAX_WTHLD_FLG'
							},                               
							{
								name: 'GMM_AMR_ACT_MTHD_CD', 
								mapping: '@GMM_AMR_ACT_MTHD_CD'
							},                                 
							{
								name: 'GMM_AMR_RULE_CD', 
								mapping: '@GMM_AMR_RULE_CD'
							},                                     
							{
								name: 'GMM_AMR_FRACTION_NUM', 
								mapping: '@GMM_AMR_FRACTION_NUM'
							},                                
							{
								name: 'GMM_SUSPEND_AMRTN_FLG', 
								mapping: '@GMM_SUSPEND_AMRTN_FLG'
							},                              
							{
								name: 'GMM_ABS_DISC_PMM_CD', 
								mapping: '@GMM_ABS_DISC_PMM_CD'
							},                                 
							{
								name: 'GMM_ABS_PP_DISC_PMM_CD ', 
								mapping: '@GMM_ABS_PP_DISC_PMM_CD'
							},                             
							{
								name: 'GMM_ABS_ME_DISC_PMM_CD', 
								mapping: '@GMM_ABS_ME_DISC_PMM_CD'
							},                              
							{
								name: 'GMM_MUNI_MKT_AMR_CD', 
								mapping: '@GMM_MUNI_MKT_AMR_CD'
							},                                 
							{
								name: 'GMM_TOT_INT_ADJ_AMT', 
								mapping: '@GMM_TOT_INT_ADJ_AMT'
							},                                 
							{
								name: 'GMM_TAX_RCL_ADJ_AMT ', 
								mapping: '@GMM_TAX_RCL_ADJ_AMT'
							},                                
							{
								name: 'GMM_TAX_WTHLD_ADJ_AMT', 
								mapping: '@GMM_TAX_WTHLD_ADJ_AMT'
							},                               
							{
								name: 'GMM_INT_CUR_GL_ADJ_AMT', 
								mapping: '@GMM_INT_CUR_GL_ADJ_AMT'
							},                              
							{
								name: 'GMM_TAX_EXP_GL_ADJ_AMT', 
								mapping: '@GMM_TAX_EXP_GL_ADJ_AMT'
							}
							// 16 end here. 
						];
							
			sortFieldInfo = {field: 'GMM_ESM_ISSUE_ID', direction: "ASC"};
			groupFieldInfo = 'GMM_LOT_NUM';
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
	
		}															
		else if(argModule == __CONST_BCAR)
		{
			if(idfParams == "")
			{
				idfParams = "&CUSIP=459200101";
			}
	
			xmlFilePath += '?__request=510037'
						+ '&__dotAsUnderscore=true'
						+ '&__fields=RCR.SSB_TRADE_ID,RCR.STATUS,RCR.RECORD_TYPE,'
						+ 'RCR.ACTION_TYPE,RCR.EXPIRATION_DATE,RCR.SSB_RECEIPT_DT,'
						+ 'RCR.DATE_POSTED,RCR.INPUT_SOURCE,RCR.COMMENTS'
						+ idfParams;
	
			recMapping = [
							{
								name: 'SSB_TRADE_ID', 
								mapping: '@RCR_SSB_TRADE_ID'
							},
							{
								name: 'STATUS', 
								mapping: '@RCR_STATUS'
							},
							{
								name: 'RECORD_TYPE', 
								mapping: '@RCR_RECORD_TYPE'
							},
							{
								name: 'ACTION_TYPE', 
								mapping: '@RCR_ACTION_TYPE'
							},					
							{
								name: 'EXPIRATION_DATE', 
								mapping: '@RCR_EXPIRATION_DATE'
							},
							{
								name: 'SSB_RECEIPT_DT', 
								mapping: '@RCR_SSB_RECEIPT_DT', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'DATE_POSTED', 
								mapping: '@RCR_DATE_POSTED', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'INPUT_SOURCE', 
								mapping: '@RCR_INPUT_SOURCE'
							},
							{
								name: 'COMMENTS', 
								mapping: '@RCR_COMMENTS'
							}
						 ];
	
			sortFieldInfo = {field: 'SSB_TRADE_ID', direction: "ASC"};
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo);		
		}
		else if(argModule == __CONST_BTRD)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=GPG1&CUSIP=459200101";
			}
	
			xmlFilePath += '?__request=510104'
						+ '&__dotAsUnderscore=true'
						+ '&__fields=SPD.SSB_TRADE_ID,SPD.SSB_TRANS_TYPE,'
						+ 'SPD.STATUS,SPD.SETTLE_LOCATION,RSM.ASSET_ID_DESCRIPTION,'
						+ 'SPD.MATURITY_DATE,SPD.TRADE_DATE,SPD.ACTUAL_SETTLE_DATE,'
						+ 'SPD.DESTINATION'
						+ idfParams;
	
			recMapping =  [
							{
								name: 'SSB_TRADE_ID', 
								mapping: '@SPD_SSB_TRADE_ID'
							},
							{
								name: 'SSB_TRANS_TYPE', 
								mapping: '@SPD_SSB_TRANS_TYPE'
							},
							{
								name: 'SPD_STATUS', 
								mapping: '@SPD_STATUS'
							},
							{
								name: 'SETTLE_LOCATION', 
								mapping: '@SPD_SETTLE_LOCATION'
							},
							{
								name: 'ASSET_ID_DESCRIPTION', 
								mapping: '@RSM_ASSET_ID_DESCRIPTION'
							},
							{
								name: 'MATURITY_DATE', 
								mapping: '@SPD_MATURITY_DATE'
							},
							{
								name: 'TRADE_DATE', 
								mapping: '@SPD_TRADE_DATE', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'ACTUAL_SETTLE_DATE', 
								mapping: '@SPD_ACTUAL_SETTLE_DATE'
							},
							{
								name: 'DESTINATION', 
								mapping: '@SPD_DESTINATION'
							}
						  ];
			groupFieldInfo = 'SPD_STATUS';
			sortFieldInfo = {field: 'SSB_TRADE_ID', direction: "ASC"};
			store = __createGroupByStore(xmlFilePath,recMapping,
											sortFieldInfo,groupFieldInfo);
		}
		else if(argModule == __CONST_CTDA)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=KDN2&CUSIP=4ALE00001";
			}
	
			xmlFilePath += '?__request=511318'
						+ '&__dotAsUnderscore=true'
						+ '&__fields=CPD.SSB_TRADE_ID,CPD.TRANS_TYPE,CPD.SETTLE_LOC,CPD.MATURITY_DATE,'
						+ 'CPD.CONT_SHARES_PAR,CPD.ACTUAL_SHARES_PAR,CPD.CONT_NET_AMOUNT,'
						+ 'CPD.ACTUAL_NET_AMOUNT,CPD.CURRENCY_CODE,CPD.TRADE_DATE,'				
						+ 'CPD.CONT_SETTLE_DATE,CPD.ACTUAL_SETTLE_DATE,CPD.SYSTEM_SETTLE_DATE,'
						+ 'CPD.EXECUTING_BROKER_NO,CPD.CLEARING_BROKER_NO'
						+ idfParams;
	
			recMapping =  [
							{
								name: 'SSB_TRADE_ID', 
								mapping: '@CPD_SSB_TRADE_ID'
							},
							{
								name: 'TRANS_TYPE', 
								mapping: '@CPD_TRANS_TYPE'
							},
							{
								name: 'SETTLE_LOC', 
								mapping: '@CPD_SETTLE_LOC'
							},
							{
								name: 'MATURITY_DATE', 
								mapping: '@CPD_MATURITY_DATE'
							},
							{
								name: 'CONT_SHARES_PAR', 
								mapping: '@CPD_CONT_SHARES_PAR'
							},
							{
								name: 'ACTUAL_SHARES_PAR', 
								mapping: '@CPD_ACTUAL_SHARES_PAR'
							},
							{
								name: 'CONT_NET_AMOUNT', 
								mapping: '@CPD_CONT_NET_AMOUNT'
							},
							{
								name: 'ACTUAL_NET_AMOUNT', 
								mapping: '@CPD_ACTUAL_NET_AMOUNT'
							},
							{
								name: 'CURRENCY_CODE', 
								mapping: '@CPD_CURRENCY_CODE'
							},
							{
								name: 'TRADE_DATE', 
								mapping: '@CPD_TRADE_DATE', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'CONT_SETTLE_DATE', 
								mapping: '@CPD_CONT_SETTLE_DATE', 
								type: 'date', 
								dateFormat: 'Yjn'
							},
							{
								name: 'ACTUAL_SETTLE_DATE', 
								mapping: '@CPD_ACTUAL_SETTLE_DATE'
							},
							{
								name: 'SYSTEM_SETTLE_DATE', 
								mapping: '@CPD_SYSTEM_SETTLE_DATE'
							},
							{
								name: 'EXECUTING_BROKER_NO', 
								mapping: '@CPD_EXECUTING_BROKER_NO'
							},
							{
								name: 'CLEARING_BROKER_NO', 
								mapping: '@CPD_CLEARING_BROKER_NO'
							}
						];
			store = __createGroupByStore(xmlFilePath,recMapping);		
		} 
		else if(argModule == __CONST_BGLM)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=KDN2&CUSIP=4ALE00001";
			}
	
			xmlFilePath += '?__request=518001'
						+ '&__dotAsUnderscore=true'
						+ '&__fields=CPD.SSB_TRADE_ID,CPD.TRANS_TYPE,CPD.SETTLE_LOC,CPD.MATURITY_DATE,'
						+ 'CPD.CONT_SHARES_PAR,CPD.ACTUAL_SHARES_PAR,CPD.CONT_NET_AMOUNT,'
						+ 'CPD.ACTUAL_NET_AMOUNT,CPD.CURRENCY_CODE,CPD.TRADE_DATE,'				
						+ 'CPD.CONT_SETTLE_DATE,CPD.ACTUAL_SETTLE_DATE,CPD.SYSTEM_SETTLE_DATE,'
						+ 'CPD.EXECUTING_BROKER_NO,CPD.CLEARING_BROKER_NO'
						+ idfParams;
	
			recMapping =  [
							{
								name: 'FUND', 
								mapping: '@JLM_FUND'
							},
							{
								name: 'ACCOUNT', 
								mapping: '@JLM_ACCOUNT'
							},
							{
								name: 'SUBACCOUNT', 
								mapping: '@JLM_SUBACCOUNT'
							},
							{
								name: 'FIN_STMT_CURRCY', 
								mapping: '@JLM_FIN_STMT_CURRCY'
							},
							{
								name: 'LOCAL_CURRCY', 
								mapping: '@JLM_LOCAL_CURRCY'
							},
							{
								name: 'POST_AMT', 
								mapping: '@JLM_POST_AMT'
							},
							{
								name: 'DR_CR_IND', 
								mapping: '@JLM_DR_CR_IND'
							},
							{
								name: 'POST_TYPE', 
								mapping: '@JLM_POST_TYPE'
							},
							{
								name: 'POST_PERIOD', 
								mapping: '@JLM_POST_PERIOD'
							},
							{
								name: 'J_POST_DT', 
								mapping: '@JLM_J_POST_DT'
							},
							{
								name: 'EFF_DT', 
								mapping: '@JLM_EFF_DT'
							},
							{
								name: 'REFERENCE_DATE', 
								mapping: '@JLM_REFERENCE_DATE'
							},
							{
								name: 'BASIS', 
								mapping: '@JLM_BASIS'
							},
							{
								name: 'SSB_TRADE_ID', 
								mapping: '@JLM_SSB_TRADE_ID'
							},
							{
								name: 'ASSET_ID', 
								mapping: '@JLM_ASSET_ID'
							},
							{
								name: 'LOT', 
								mapping: '@JLM_LOT'
							},
							{
								name: 'ADDED_DT', 
								mapping: '@JLM_ADDED_DT'
							},
							{
								name: 'ADDED_TIME', 
								mapping: '@JLM_ADDED_TIME'
							},
							//Post Program	??
							{
								name: 'POST_NUM', 
								mapping: '@JLM_POST_NUM'
							},
							{
								name: 'POST_SEQ', 
								mapping: '@JLM_POST_SEQ'
							},
							{
								name: 'ADDED_USERID', 
								mapping: '@JLM_ADDED_USERID'
							},
							{
								name: 'POSTING_RULE', 
								mapping: '@JLM_POSTING_RULE'
							}
						];
			store = __createGroupByStore(xmlFilePath,recMapping);		
		} 
		else if(argModule == __CONST_BRFD)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=CAC0&ASSET_ID=7139909C5&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807074'
						+ '&__dotAsUnderscore=true'
						+ idfParams;

			recMapping =  [
							{
								name:'ACCOUNT_NO',
								mapping:'@RFD_ACCOUNT_NO'
							}, 
							{
								name:'FUND',
								mapping:'@RFD_FUND'
							},                 	
							{
								name:'CUSIP',
								mapping:'@RFD_CUSIP'
							},                	
							{
								name:'CURRENCY_CODE',
								mapping:'@RFD_CURRENCY_CODE'
							},        	
							{
								name:'MARKET_PRICE_CURRENCY',
								mapping:'@RFD_MARKET_PRICE_CURRENCY'
							},
							{
								name:'PAR_SHARE',
								mapping:'@RFD_PAR_SHARE'
							},	           	
							{
								name:'COST_ID',
								mapping:'@RFD_COST_ID'
							},             	
							{
								name:'COST_AVG',
								mapping:'@RFD_COST_AVG'
							},            	
							{
								name:'EXCH_RATE',
								mapping:'@RFD_EXCH_RATE'
							},            	
							{
								name:'MARKET_VALUE',
								mapping:'@RFD_MARKET_VALUE'
							},        	
							{
								name:'PRICE',
								mapping:'@RFD_PRICE'
							},               	
							{
								name:'MARKET_PRICE',
								mapping:'@RFD_MARKET_PRICE'
							},         	
							{
								name:'PCU',
								mapping:'@RFD_PCU'
							},                 	
							{
								name:'ASSET_GROUP',
								mapping:'@RFD_ASSET_GROUP'
							},           	
							{
								name:'PAR_SHARE_RESTRICTED',
								mapping:'@RFD_PAR_SHARE_RESTRICTED'
							},
							{
								name:'PAR_SHARE_COLLATERAL',
								mapping:'@RFD_PAR_SHARE_COLLATERAL'
							},	
							{
								name:'COST_LOC_ID',
								mapping:'@RFD_COST_LOC_ID'
							},	        	
							{
								name:'COST_LOC_AVG',
								mapping:'@RFD_COST_LOC_AVG'
							},         	
							{
								name:'COST_RESTRICT',
								mapping:'@RFD_COST_RESTRICT'
							},        	
							{
								name:'COST_LOC_RESTRICT',
								mapping:'@RFD_COST_LOC_RESTRICT'
							},   	
							{
								name:'PRICE_CURRENCY',
								mapping:'@RFD_PRICE_CURRENCY'
							},     	
							{
								name:'MARKET_VALUE_TYPE',
								mapping:'@RFD_MARKET_VALUE_TYPE'
							},   	
							{
								name:'ORIG_FACE_POSITION',
								mapping:'@RFD_ORIG_FACE_POSITION'
							}, 	
							{
								name:'MCH_PRICE',
								mapping:'@RFD_MCH_PRICE'
							},             	
							{
								name:'ADD_PROGRAM_ID',
								mapping:'@RFD_ADD_PROGRAM_ID'
							},     	
							{
								name:'DATE_ADDED',
								mapping:'@RFD_DATE_ADDED', 
								type: 'date', 
								dateFormat: 'Ynj'
							},           	
							{
								name:'TIME_ADDED',
								mapping:'@RFD_TIME_ADDED', 
								type: 'date', 
								dateFormat: 'Ynj'
							},          	
							{
								name:'UPD_PROGRAM_ID',
								mapping:'@RFD_UPD_PROGRAM_ID'
							},      	
							{
								name:'DATE_UPDATED',
								mapping:'@RFD_DATE_UPDATED', 
								type: 'date', 
								dateFormat: 'Ynj'
							},         	
							{
								name:'TIME_UPDATED',
								mapping:'@RFD_TIME_UPDATED', 
								type: 'date', 
								dateFormat: 'Ynj'
							},        	
							{
								name:'PRICE_CARRY',
								mapping:'@RFD_PRICE_CARRY'
							},        	
							{
								name:'STALE_PRICE',
								mapping:'@RFD_STALE_PRICE'
							},        	
							{
								name:'PRICE_UPD_DATE',
								mapping:'@RFD_PRICE_UPD_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},      	
							{
								name:'ASSET_DESCRIPTION',
								mapping:'@RFD_ASSET_DESCRIPTION'
							}   
					  ];			
			store = __createGroupByStore(xmlFilePath,recMapping);		
		} 
		else if(argModule == __CONST_BRKP)
		{
			if(idfParams == "")
			{
				idfParams = "&FUND=KDN2&ASSET_ID=4ALE00001&CLC_BASIS=IFRS";
			}
	
			xmlFilePath += '?__request=807075'
						+ '&__dotAsUnderscore=true'
						+ idfParams;

			recMapping = [
							{
								name:'FUND',
								mapping:'@RKS_FUND'
							},
							{
								name:'CUSIP',
								mapping:'@RKS_CUSIP'
							},
							{
								name:'TRADE_DATE',
								mapping:'@RKS_TRADE_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'POSTED_DATE',
								mapping:'@RKS_POSTED_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'SSB_TRANS_TYPE',
								mapping:'@RKS_SSB_TRANS_TYPE'
							},
							{
								name:'ACCOUNT',
								mapping:'@RKS_ACCOUNT'
							},
							{
								name:'ISSUE_ACCOUNT_NO',
								mapping:'@RKS_ISSUE_ACT_NO'
							},
							{
								name:'LOT',
								mapping:'@RKS_LOT'
							},
							{
								name:'SSB_TRADE_ID',
								mapping:'@RKS_SSB_TRADE_ID'
							},
							{
								name:'TIME_UPDATED',
								mapping:'@RKS_TIME_UPDATED', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'CANCELLATION',
								mapping:'@RKS_CANCELLATION'
							},
							{
								name:'SSB_VALUE_DATE',
								mapping:'@RKS_SSB_VALUE_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'BRKR_FINS',
								mapping:'@RKS_BRKR_FINS'
							},
							{
								name:'SSB_TRADE_ID_XREF',
								mapping:'@RKS_SSB_TRADE_ID_XREF'
							},
							{
								name:'SHARE_PAR_QTY',
								mapping:'@RKS_SHARE_PAR_QTY'
							},
							{
								name:'FUND_REFNO',
								mapping:'@RKS_FUND_REFNO'
							},
							{
								name:'SSB_TRADE_ID_SETL',
								mapping:'@RKS_SSB_TRADE_ID_SETL'
							},
							{
								name:'TURN_AROUND_FLAG',
								mapping:'@RKS_TURN_AROUND_FLAG'
							},
							{
								name:'CURRENCY_LOC',
								mapping:'@RKS_CURRENCY_LOC'
							},
							{
								name:'CURRENCY_STL',
								mapping:'@RKS_CURRENCY_STL'
							},
							{
								name:'PA_ONLY_FLAG',
								mapping:'@RKS_PA_ONLY_FLAG'
							},
							{
								name:'NET_AMOUNT_LOC',
								mapping:'@RKS_NET_AMOUNT_LOC'
							},
							{
								name:'NET_AMOUNT',
								mapping:'@RKS_NET_AMOUNT'
							},
							{
								name:'NET_AMOUNT_STL',
								mapping:'@RKS_NET_AMOUNT_STL'
							},
							{
								name:'INT_BOT_SOLD_LOC',
								mapping:'@RKS_INT_BOT_SOLD_LOC'
							},
							{
								name:'INT_BOT_SOLD',
								mapping:'@RKS_INT_BOT_SOLD'
							},
							{
								name:'NET_TRADE_IND',
								mapping:'@RKS_NET_TRADE_IND'
							},
							{
								name:'SETTLE_LOC',
								mapping:'@RKS_SETTLE_LOC'
							},
							{
								name:'UNIT_PRICE_LOC',
								mapping:'@RKS_UNIT_PRICE_LOC'
							},
							{
								name:'UNIT_PRICE',
								mapping:'@RKS_UNIT_PRICE'
							},
							{
								name:'FEES_LOC',
								mapping:'@RKS_FEES_LOC'
							},
							{
								name:'FEES',
								mapping:'@RKS_FEES'
							},
							{
								name:'ORIGINAL_FACE_VALUE',
								mapping:'@RKS_ORIGINAL_FACE_VALUE'
							},
							{
								name:'CONT_SETTLE_DATE',
								mapping:'@RKS_CONT_SETTLE_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'TAXES_LOC',
								mapping:'@RKS_TAXES_LOC'
							},
							{
								name:'TAXES',
								mapping:'@RKS_TAXES'
							},
							{
								name:'ERISA_COST',
								mapping:'@RKS_ERISA_COST'
							},
							{
								name:'ACT_SETTLE_DATE',
								mapping:'@RKS_ACT_SETTLE_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'COMMISSION_LOC',
								mapping:'@RKS_COMMISSION_LOC'
							},
							{
								name:'COMMISSION',
								mapping:'@RKS_COMMISSION'
							},
							{
								name:'ACCTG_PERIOD_END_DATE',
								mapping:'@RKS_ACCTG_PERIOD_END_DATE', 
								type: 'date', 
								dateFormat: 'Ynj'
							},
							{
								name:'OTHER_CHRGS_LOC',
								mapping:'@RKS_OTHER_CHRGS_LOC'
							},
							{
								name:'OTHER_CHRGS',
								mapping:'@RKS_OTHER_CHRGS'
							},
							{
								name:'AVG_COST_LOC_ORIG',
								mapping:'@RKS_AVG_COST_LOC_ORIG'
							},
							{
								name:'AVG_COST_LOC_CURR',
								mapping:'@RKS_AVG_COST_LOC_CURR'
							},
							{
								name:'EX_RATE_LOC_BASE',
								mapping:'@RKS_EX_RATE_LOC_BASE'
							},
							{
								name:'EX_RATE_STL',
								mapping:'@RKS_EX_RATE_STL'
							}
						 ];	
			
			store = __createGroupByStore(xmlFilePath,recMapping);		
		}
		return store;
	}
	
	function __getDsColumns(argModule)
	{
		var dsCols = null;
		if(argModule == __CONST_BGMM)
		{
			dsCols = [
						{
							header: "Asset ID", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'CUSIP',tooltip: "Asset ID"
						},
						{
							 header: "Lot", 
							 width: 50, sortable: true, locked:false, 
							 dataIndex: 'PA_LOT',tooltip: "Pa_Lot"
						},	
						{
							header: "Fund", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'FUND',tooltip: "Fund"
						},
						{
							header: "Freq_Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'FREQ_CODE',tooltip: "Freq_Code"},			
						{
							header: "Issue Class", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'ISSUE_CLASS',tooltip: "Issue Class"
						},
						{
							header: "Maturity Date", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'MAT_DATE',tooltip: "Maturity Date",
							renderer:__formatDate
						},
						{
							header: "Coupon", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'COUPON',tooltip: "Coupon",
							align:'right',renderer:__fmtDoubleValue
						},
						{
							header: "Variable Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'VAR_RATE',tooltip: "Variable Rate",
							align:'right',renderer:__fmtDoubleValue
						},
						{
							header: "ODD Coupon", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ODD_COUP',tooltip: "ODD Coupon"
						},
						{
							header: "State Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'STATE_CODE',tooltip: "State Code"
						},
						{
							header: "Country Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'COUNTRY_CODE',tooltip: "Country Code"
						},
						{
							header: "Maturity Days", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'DAYS_MAT',tooltip: "Maturity Days"
						},
						{
							header: "Income Days", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'INCOM_DAYS',tooltip: "Income Days"
						},
						{
							header: "Basis Indicator", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'BASIS_IND',tooltip: "Basis Indicator"
						},
						{
							header: "Upd_Program_ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'UPD_PROGRAM_ID',tooltip: "Upd_Program_ID"
						},
						{
							header: "Updated Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'DATE_UPDATED',tooltip: "Updated Date",
							renderer:__formatDate
						},
						{
							header: "ICRS User", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'ICRS_USER',tooltip: "ICRS User"
						},
						{
							header: "ICRS Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'ICRS_DATE',tooltip: "ICRS Date"
						},
						{
							header: "Issue Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'ISSUE_DATE',tooltip: "Issue Date",
							renderer:__formatDate
						},
						{
							header: "Incom Dat1", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'INCOM_DAT1',tooltip: "Incom Dat1"
						},
						{
							header: "Incom Dat2", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'INCOM_DAT2',tooltip: "Incom Dat2"
						},
						{
							header: "CALC_PUR_INT", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CALC_PUR_INT',
							tooltip: "CALC_PUR_INT",align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Tax Status", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'TAX_STATUS',tooltip: "Tax Status"
						},
						{
							header: "Deferral", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'DEFERRAL',tooltip: "Deferral"
						},
						{
							header: "Acru", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'ACRU',tooltip: "Acru"
						},
						{
							header: "Acru Tax", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'ACRU_TAX',tooltip: "Acru tax"
						},
						{
							header: "Var_Rate_Freq", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'VAR_RATE_FREQ',tooltip: "Var_Rate_Freq"
						},
						{
							header: "Account", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'ACCOUNT',tooltip: "Account"
						},
						{
							header: "Issue Account No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ISSUE_ACCOUNT_NO',tooltip: "Account"
						},
						{
							header: "Rate Changed Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'VAR_RATE_CHANGE_DATE',
							tooltip: "Rate Changed Date"
						}
					];		
		}
		else if(argModule == __CONST_BGMM5)
		{
			dsCols = [
						{
							header: "Fund", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FUND_ID',tooltip: "Fund"
						},	
						// 1st 25 start here.
						{
							header: "Asset ID", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ESM_ISSUE_ID',tooltip: "Asset ID"
						},
						{
							header: "Calc Basis Cd", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLC_BASIS_CD'
						},
						// For Joanna
						{
							header: "Buy Date", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_BUY_DT',renderer:__formatDate
						},
						{
							header: "Lot", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LOT_NUM',tooltip: "Lot Number"
						},
						{
							header: "Maturity Date", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_MTRTY_DT',
							tooltip: "Maturity Date",renderer:__formatDate
						},
						{
							header: "Coupon Rate", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_COUPON_RT',
							tooltip: "Coupon Rate",align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Currency Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_CURR_CD'
						},
						{
							header: "Exchg Rate", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_XCHG_RT'
						},
						// Available on Taxlot-Fin
						{
							header: "Buy Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_BUY_CD'
						},
						{
							header: "Restricted Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_RESTRICT_FLG'
						},
						{
							header: "Long Short Cd", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LONG_SHORT_CD'
						},
						{
							header: "Rept Cls Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REPT_CLS_CD'
						},
						{
							header: "ODD Coupon Flag", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ODD_CPN_FLG'
						},
						{
							header: "Govt Ind Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_GOVT_IND_FLG'
						},
						{
							header: "State Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_STATE_CD',
							tooltip: "State Code"
						},
						{
							header: "Par Shr Num", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_PAR_SHR_NUM'
						},	
						// Available on Taxlot-Fin
						{
							header: "Face Amt", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FACE_AMT'
						},
						{
							header: "Collateral Par Amt", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLTRL_PAR_AMT'
						},						
						{
							header: "Issue Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ISSUE_DT',tooltip: "Issue Date",
							renderer:__formatDate
						},
						{
							header: "Settle Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_SETTLE_DT',tooltip: "Settle Date",
							renderer:__formatDate
						},
						{
							header: "Reverse Repo Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REVERSE_REPO_FLG'
						},
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REPO_CD'
						},						
						{
							header: "Tax Status Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_STATUS_CD',
							tooltip: "Tax Status Code"
						},
						{
							header: "Amort Ind Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMORT_IND_CD'
						},
						// 25 End Here              						
						{
							header: "Account", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCOUNT_NUM',tooltip: "Account No"
						},
						// For Joanna
						{
							header: "Issue Account No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ISSUE_ACCT_NUM'
						},
						// For Joanna
						{
							header: "Accrue Stop Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUE_STOP_CD'
						},	
						// 33 Start here ( less ONE )
						{
							header: "Accrue Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUE_DT',renderer:__formatDate
						}, 
						{
							header: "Accrual Exchg Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUAL_XCHG_RT'
						},                                                     
						{
							header: "Accrual Exchg Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUAL_XCHG_DT',
							renderer:__formatDate
						},					
						{
							header: "Days Spent Amr No", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_DAYS_SPENT_AMR_NUM'
						},                              
						{
							header: "total Acr Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TOT_ACR_AMT'
						},
						{
							header: "Accr Fact Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCR_FACT_AMT'
						},
						{
							header: "Accr Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCR_ADJ_AMT'
						},
						{
							header: "Accrued Total Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUED_TOT_AMT'
						},
						{
							header: "Acr Int Tx Exp Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_INT_TX_EXP_AMT'
						},
						{
							header: "Acr Int Tx Ref Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_INT_TX_REF_AMT'
						},
						{
							header: "Acr Crnt Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_CRNT_AMT'
						},
						{
							header: "Int Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_INT_CURR_GL_AMT'
						},
						{
							header: "Acr Prior Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_PRIOR_AMT'
						},
						{
							header: "Tax Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_CURR_GL_AMT'
						},						
						{
							header: "Acre Taxes Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_TAXES_FLG'
						},                                 
						{
							header: "Acre Act Method Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_ACT_MTHD_CD'
						},
						{
							header: "Acre Rule Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_RULE_CD'
						},
						{
							header: "Amrtn Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_FLG'
						},						
						{
							header: "Last Amort Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_LAST_AMORT_DT',
							renderer:__formatDate
						},
						{
							header: "Amrtn Type Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_TYPE_CD'
						},
						{
							header: "Amrtn Option Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_OPTION_CD'
						},
						{
							header: "Mkt Amrtn Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_MKT_AMRTN_FLG'
						},
						{
							header: "OI Amrtn Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_OI_AMRTN_FLG'
						},
						{
							header: "P Or D OI flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_P_OR_D_OI_FLG'
						},						
						{
							header: "Amrtz Exchg Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTZ_XCHG_RT'
						},                                                                       
						{
							header: "Amr Exchg Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_XCHG_DT',renderer:__formatDate
						},
						{
							header: "Avg Tot Amrtz Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AVG_TOT_AMRTZ_AMT'
						},
						{
							header: "Amr Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_CURR_GL_AMT'
						},
						{
							header: "Amr Tax Exp Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_EXP_AMT'
						},
						{
							header: "Amr Tax Ref Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_REF_AMT'
						},    
						{
							header: "Amr Prior Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_PRIOR_AMT'
						},
						//  33 End here							      
						{
							header: "Amr Count", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_CNT'
						},
						// 16 start here.
						{
							header: "Amr Adj Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_ADJ_CD'
						},                                     
						{
							header: "Amr Tax Wthld Flag", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_WTHLD_FLG'
						},
						{
							header: "Amrt Act Method Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_ACT_MTHD_CD'
						},
						{
							header: "Amr Rule Code", 
							width: 50, sortable: true,locked:false, 
							dataIndex: 'GMM_AMR_RULE_CD'
						},
						{
							header: "Amr Fract Num", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_FRACTION_NUM',
							tooltip: "Amr Fraction Number"
						},                               
						{
							header: "Suspend Amrtn Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_SUSPEND_AMRTN_FLG'
						},
						{
							header: "Abs Disc PMM Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_DISC_PMM_CD'
						},
						{
							header: "Abs Pp Disc PMM Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_PP_DISC_PMM_CD'
						},
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_ME_DISC_PMM_CD'
						},                   
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_MUNI_MKT_AMR_CD'
						},						
						{
							header: "Tot Int Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TOT_INT_ADJ_AMT'
						},
						{
							header: "Tax Rcl Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_RCL_ADJ_AMT'
						},
						{
							header: "Tax Wthld Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_WTHLD_ADJ_AMT'
						},
						{
							header: "Int Cur GL Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_INT_CUR_GL_ADJ_AMT'
						},
						{
							header: "Tax Exp Gl Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_EXP_GL_ADJ_AMT'
						}
						// 16 end here.
					];		
		}	
		else if(argModule == __CONST_MULT_LOT_DET)
		{
			dsCols = [
						{
							header: "Fund", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FUND_ID',tooltip: "Fund"
						},
						// 1st 25 start here.
						{
							header: "Asset ID", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ESM_ISSUE_ID',
							tooltip: "Asset ID"
						},
						{
							header: "Calc Basis Cd", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLC_BASIS_CD'
						},
						// For Joanna
						{
							header: "Buy Date", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_BUY_DT',renderer:__formatDate
						},
						{
							header: "Lot", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LOT_NUM',tooltip: "Lot Number"
						},
						{
							header: "Maturity Date", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_MTRTY_DT',
							tooltip: "Maturity Date",
							renderer:__formatDate
						},
						{
							header: "Coupon Rate", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_COUPON_RT',
							tooltip: "Coupon Rate",align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Currency Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_CURR_CD'
						},
						{
							header: "Exchg Rate", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_XCHG_RT'
						}, 
						// Available on Taxlot-Fin
						{
							header: "Buy Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_BUY_CD'
						},
						{
							header: "Restricted Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_RESTRICT_FLG'
						},
						{
							header: "Long Short Cd", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LONG_SHORT_CD'
						},
						{
							header: "Rept Cls Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REPT_CLS_CD'
						},
						{
							header: "ODD Coupon Flag", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ODD_CPN_FLG'
						},
						{
							header: "Govt Ind Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_GOVT_IND_FLG'
						},
						{
							header: "State Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_STATE_CD',tooltip: "State Code"
						},
						{
							header: "Par Shr Num", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_PAR_SHR_NUM'
						},
						// Available on Taxlot-Fin
						{
							header: "Face Amt", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FACE_AMT'
						},
						{
							header: "Collateral Par Amt", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLTRL_PAR_AMT'
						},						
						{
							header: "Issue Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ISSUE_DT',tooltip: "Issue Date",
							renderer:__formatDate
						},
						{
							header: "Settle Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_SETTLE_DT',
							tooltip: "Settle Date",
							renderer:__formatDate
						},
						{
							header: "Reverse Repo Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REVERSE_REPO_FLG'
						},
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_REPO_CD'
						},						
						{
							header: "Tax Status Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_STATUS_CD',
							tooltip: "Tax Status Code"
						},
						{
							header: "Amort Ind Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMORT_IND_CD'
						},
						// 25 End Here              						
						{
							header: "Account", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCOUNT_NUM',
							tooltip: "Account No"
						},
						// For Joanna
						{
							header: "Issue Account No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ISSUE_ACCT_NUM'
						} 
						// For Joanna
					];		
		}		
		else if(argModule == __CONST_LOT_WITH_DET)
		{
			dsCols = [
						{
							header: "Fund", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FUND_ID',tooltip: "Fund"
						},
						// 1st 25 start here.
						{
							header: "Asset ID", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ESM_ISSUE_ID',
							tooltip: "Asset ID"
						},
						{
							header: "Calc Basis Cd", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLC_BASIS_CD'
						},
						// For Joanna
						{
							header: "Lot", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LOT_NUM',tooltip: "Lot Number"
						},						
						// for group by
						{
							header: "Accrue Stop Code", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUE_STOP_CD'
						},
						// 33 Start here ( less ONE )
						{
							header: "Accrue Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUE_DT',
							renderer:__formatDate
						}, 
						{
							header: "Accrual Exchg Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUAL_XCHG_RT'
						},                                                     
						{
							header: "Accrual Exchg Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUAL_XCHG_DT',
							renderer:__formatDate
						},					
						{
							header: "Days Spent Amr No", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_DAYS_SPENT_AMR_NUM'
						},                              
						{
							header: "total Acr Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TOT_ACR_AMT'
						},
						{
							header: "Accr Fact Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCR_FACT_AMT'
						},
						{
							header: "Accr Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCR_ADJ_AMT'
						},
						{
							header: "Accrued Total Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACCRUED_TOT_AMT'
						},
						{
							header: "Acr Int Tx Exp Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_INT_TX_EXP_AMT'
						},
						{
							header: "Acr Int Tx Ref Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_INT_TX_REF_AMT'
						},
						{
							header: "Acr Crnt Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_CRNT_AMT'
						},
						{
							header: "Int Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_INT_CURR_GL_AMT'
						},
						{
							header: "Acr Prior Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_ACR_PRIOR_AMT'
						},
						{
							header: "Tax Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_CURR_GL_AMT'
						},						
						{
							header: "Acre Taxes Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_TAXES_FLG'
						},                                 
						{
							header: "Acre Act Method Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_ACT_MTHD_CD'
						},
						{
							header: "Acre Rule Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_ACRE_RULE_CD'
						},
						{
							header: "Amrtn Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_FLG'
						},						
						{
							header: "Last Amort Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_LAST_AMORT_DT',
							renderer:__formatDate
						},
						{
							header: "Amrtn Type Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_TYPE_CD'
						},
						{
							header: "Amrtn Option Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTN_OPTION_CD'
						},
						{
							header: "Mkt Amrtn Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_MKT_AMRTN_FLG'
						},
						{
							header: "OI Amrtn Flag", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_OI_AMRTN_FLG'
						},
						{
							header: "P Or D OI flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_P_OR_D_OI_FLG'
						},						
						{
							header: "Amrtz Exchg Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_AMRTZ_XCHG_RT'
						},                                                                       
						{
							header: "Amr Exchg Date", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_XCHG_DT',
							renderer:__formatDate
						},
						{
							header: "Avg Tot Amrtz Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AVG_TOT_AMRTZ_AMT'
						},
						{
							header: "Amr Curr GL Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_CURR_GL_AMT'
						},
						{
							header: "Amr Tax Exp Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_EXP_AMT'
						},
						{
							header: "Amr Tax Ref Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_REF_AMT'
						},    
						{
							header: "Amr Prior Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_PRIOR_AMT'
						}
						//  33 End here							      
					];		
		}
		else if(argModule == __CONST_LOT_ADJ_DET)
		{
			dsCols = [
						{
							header: "Fund", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_FUND_ID',tooltip: "Fund"
						},
						// 1st 25 start here.
						{
							header: "Asset ID", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ESM_ISSUE_ID',tooltip: "Asset ID"
						},
						{
							header: "Calc Basis Cd", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_CLC_BASIS_CD'
						},
						// For Joanna
						{
							header: "Lot", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_LOT_NUM',tooltip: "Lot Number"
						},
						// for Group by
						{
							header: "Amr Count", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_CNT'
						},
						// 16 start here.
						{
							header: "Amr Adj Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_ADJ_CD'
						},                                     
						{
							header: "Amr Tax Wthld Flag", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_TAX_WTHLD_FLG'
						},
						{
							header: "Amrt Act Method Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_ACT_MTHD_CD'
						},
						{
							header: "Amr Rule Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_RULE_CD'
						},
						{
							header: "Amr Fract Num", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'GMM_AMR_FRACTION_NUM',
							tooltip: "Amr Fraction Number"
						},                               
						{
							header: "Suspend Amrtn Flag", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_SUSPEND_AMRTN_FLG'
						},
						{
							header: "Abs Disc PMM Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_DISC_PMM_CD'
						},
						{
							header: "Abs Pp Disc PMM Code", 
							width: 80, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_PP_DISC_PMM_CD'
						},
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_ABS_ME_DISC_PMM_CD'
						},                   
						{
							header: "Repo Code", 
							width: 50, sortable: true, locked:false, 
							dataIndex: 'GMM_MUNI_MKT_AMR_CD'
						},						
						{
							header: "Tot Int Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TOT_INT_ADJ_AMT'
						},
						{
							header: "Tax Rcl Adj Amt", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_RCL_ADJ_AMT'
						},
						{
							header: "Tax Wthld Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_WTHLD_ADJ_AMT'
						},
						{
							header: "Int Cur GL Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_INT_CUR_GL_ADJ_AMT'
						},
						{
							header: "Tax Exp Gl Adj Amt", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'GMM_TAX_EXP_GL_ADJ_AMT'
						}	
						// 16 end here.
					];		
		}					
		else if(argModule == __CONST_BCAR)
		{
			dsCols = [
						{
							id:'trade_id',
							header: "Trade ID", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Status", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'STATUS'
						},
						{
							header: "Record Type", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'RECORD_TYPE'
						},
						{
							header: "Action Type", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'ACTION_TYPE'
						},
						{
							header: "Expiration Date", 
							width: 110, sortable: true, locked:false, 
							dataIndex: 'EXPIRATION_DATE',
							renderer:__fmtDateString
						},
						{
							header: "Receipt Date", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'SSB_RECEIPT_DT',renderer:__formatDate
						},
						{
							header: "Date Posted", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'DATE_POSTED',renderer:__formatDate
						},
						{
							header: "Input Source", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'INPUT_SOURCE'
						},
						{
							header: "Comments", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'COMMENTS'
						}
					];		
		}
		else if(argModule == __CONST_BTRD)
		{
			dsCols = [
						{
							id:'trade_id',
							header: "Trade ID", width: 70, sortable: true, 
							locked:false, dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Trans Type", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'SSB_TRANS_TYPE'
						},
						{
							header: "Status", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'SPD_STATUS'
						},
						{
							header: "Settle Location", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'SETTLE_LOCATION'
						},
						{
							header: "Security Desc", 
							width: 110, sortable: true, locked:false, 
							dataIndex: 'ASSET_ID_DESCRIPTION'
						},
						{
							header: "Mat Date", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'MATURITY_DATE',
							renderer:__fmtDateString
						},	
						{
							header: "Trade Date", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'TRADE_DATE',
							renderer:__formatDate
						},	
						{
							header: "Actual Settle Date", 
							width: 110, sortable: true, locked:false, 
							dataIndex: 'ACTUAL_SETTLE_DATE',
							renderer:__fmtDateString
						},	
						{
							header: "Destination", 
							width: 90, sortable: true, locked:false, 
							dataIndex: 'DESTINATION'
						}
					];		
		}
		else if(argModule == __CONST_CTDA)
		{
			dsCols = [
						{
							id:'trade_id',
							header: "Trade ID", width: 80, sortable: true, 
							locked:false, dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Transaction Type", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TRANS_TYPE'
						},	
						{
							header: "Settle Loc", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'SETTLE_LOC'
						},	
						{
							header: "Maturity Date", 
							width: 70, sortable: true, locked:false, 
							dataIndex: 'MATURITY_DATE',
							renderer:__fmtDateString
						},	
						{
							header: "Contractual Shares/Par", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'CONT_SHARES_PAR',align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Actual Shares/Par", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACTUAL_SHARES_PAR',align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Cont Net Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CONT_NET_AMOUNT',align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Actual Net Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACTUAL_NET_AMOUNT',align:'right',
							renderer:__fmtDoubleValue
						},
						{
							header: "Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CURRENCY_CODE'
						},
						{
							header: "Trade Date", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'TRADE_DATE',renderer:__formatDate
						},
						{
							header: "Cont Settle Date", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'CONT_SETTLE_DATE',
							renderer:__formatDate
						},
						{
							header: "Actual Settle Date", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'ACTUAL_SETTLE_DATE',
							renderer:__fmtDateString
						},
						{
							header: "System Settle Date", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'SYSTEM_SETTLE_DATE',
							renderer:__fmtDateString
						},
						{
							header: "Executing Broker Code", 
							width: 120, sortable: true, locked:false, 
							dataIndex: 'EXECUTING_BROKER_NO'
						},
						{
							header: "Clearing Broker Code", 
							width: 110, sortable: true, locked:false, 
							dataIndex: 'CLEARING_BROKER_NO'
						}
					 ];		
		}
		else if(argModule == __CONST_BGLM)
		{
			dsCols = [
						{
							id:'trade_id',
							header: "Trade ID", width: 70, sortable: true, 
							locked:false, dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Fund", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FUND'
						},
						{
							header: "Account", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACCOUNT'
						},
						{
							header: "Sub Account", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SUBACCOUNT'
						},
						{
							header: "Financial Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FIN_STMT_CURRCY'
						},
						{
							header: "Local Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'LOCAL_CURRCY'
						},
						{
							header: "Post Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POST_AMT'
						},
						{
							header: "D/C", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'DR_CR_IND'
						},
						{
							header: "Post Type", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POST_TYPE'
						},
						{
							header: "Post Period", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POST_PERIOD'
						},
						{
							header: "Posted Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'J_POST_DT'
						},
						{
							header: "Effective Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'EFF_DT'
						},
						{
							header: "Reference Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'REFERENCE_DATE'
						},
						{
							header: "Basis", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'BASIS'
						},
						{
							header: "Trade Id", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Asset Id", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ASSET_ID'
						},
						{
							header: "Lot", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'LOT'
						},
						{
							header: "Date Added", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ADDED_DT'
						},
						{
							header: "Time Added", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ADDED_TIME'
						},
						//Post Program	??
						{
							header: "Post Number", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POST_NUM'
						},
						{
							header: "Post Sequence", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POST_SEQ'
						},
						{
							header: "User Id", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ADDED_USERID'
						},
						{
							header: "Posting Rule", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POSTING_RULE'
						}
					];		
		}
		else if(argModule == __CONST_BRFD)
		{
			dsCols = [						
						{
							header: "Fund", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FUND'
						},
						{
							header: "Cusip", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CUSIP'
						},
						{
							header: "Currency Code", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CURRENCY_CODE'
						},
						{
							header: "Market Price Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'MARKET_PRICE_CURRENCY'
						},	
						{
							header: "Long Position", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PAR_SHARE'
						},
						{
							header: "ID Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_ID'
						},
						{
							header: "Average Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_AVG'
						},
						{
							header: "Exchange Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'EXCH_RATE'
						},
						{
							header: "Market Value", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'MARKET_VALUE'
						},
						{
							header: "PCU", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PCU'
						},
						{
							header: "Asset Group", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ASSET_GROUP'
						},
						{
							header: "Share Par Restricted", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PAR_SHARE_RESTRICTED'
						},
						{
							header: "Share Par Collateral", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PAR_SHARE_COLLATERAL'
						},
						{
							header: "Local Cost ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_LOC_ID',renderer:__fmtExpValue
						},	
						{
							header: "Local Cost Average", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_LOC_AVG',renderer:__fmtExpValue
						},
						{
							header: "Restricted Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_RESTRICT'
						},
						{
							header: "Local Restricted Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COST_LOC_RESTRICT'
						},
						{
							header: "Price Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PRICE_CURRENCY'
						},
						{
							header: "Market Value Type", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'MARKET_VALUE_TYPE'
						},	
						{
							header: "Original Face Position", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ORIG_FACE_POSITION'
						},
						{
							header: "MCH Price", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'MCH_PRICE'
						},
						{
							header: "Add Program ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ADD_PROGRAM_ID'
						},
						{
							header: "Date Added", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'DATE_ADDED',renderer:__formatDate
						},
						{
							header: "Time Added", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TIME_ADDED',renderer:__formatDate
						},	
						{
							header: "Update Program ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'UPD_PROGRAM_ID'
						},
						{
							header: "Date Updated", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'DATE_UPDATED',renderer:__formatDate
						},
						{
							header: "Time Updated", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TIME_UPDATED',renderer:__formatDate
						},
						{
							header: "Price Carry", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PRICE_CARRY'
						},
						{
							header: "Stale Price", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'STALE_PRICE'
						},	
						{
							header: "Price Updated Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PRICE_UPD_DATE',renderer:__formatDate
						},
						{
							header: "Issue Account No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACCOUNT_NO'
						},
						{
							header: "Asset Description", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ASSET_DESCRIPTION'
						}
					];				
		}
		else if(argModule == __CONST_BRKP)
		{
			dsCols = [
						{
							header: "Fund", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FUND'
						},
						{
							header: "Asset ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CUSIP'
						},
						{
							header: "Trade Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TRADE_DATE',renderer:__formatDate
						},
						{
							header: "Posted Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'POSTED_DATE',renderer:__formatDate
						},
						{
							header: "SSB Trans Type", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_TRANS_TYPE'
						},
						{
							header: "Account", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACCOUNT'
						},
						{
							header: "Issue Account No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ISSUE_ACCOUNT_NO'
						},				
						{
							header: "Lot", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'LOT'
						},
						{
							header: "SSB Trade ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_TRADE_ID'
						},
						{
							header: "Updated Timestamp", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TIME_UPDATED',renderer:__formatDate
						},
						{
							header: "Cancellation", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CANCELLATION'
						},
						{
							header: "SSB Value Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_VALUE_DATE',renderer:__formatDate
						},
						{
							header: "Broker Fins", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'BRKR_FINS'
						},
						{
							header: "SSB Trade ID Xref", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_TRADE_ID_XREF'
						},
						{
							header: "Share Par Qty", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SHARE_PAR_QTY'
						},
						{
							header: "Fund Ref No", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FUND_REFNO'
						},
						{
							header: "Settlement Trade ID", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SSB_TRADE_ID_SETL'
						},
						{
							header: "Turn Around", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TURN_AROUND_FLAG'
						},
						{
							header: "Local Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CURRENCY_LOC'
						},
						{
							header: "Settlement Currency", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CURRENCY_STL'
						},
						{
							header: "PA Only Flag", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'PA_ONLY_FLAG'
						},
						{
							header: "Local Net Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'NET_AMOUNT_LOC'
						},
						{
							header: "Net Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'NET_AMOUNT'
						},
						{
							header: "Settlement Net Amount", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'NET_AMOUNT_STL'
						},
						{
							header: "Local Interest Bought Sold", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'INT_BOT_SOLD_LOC'
						},
						{
							header: "Interest Bought Sold", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'INT_BOT_SOLD'
						},
						{
							header: "Net Trade Indicator", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'NET_TRADE_IND'
						},
						{
							header: "Settlement Location", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'SETTLE_LOC'
						},
						{
							header: "Local Unit Price", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'UNIT_PRICE_LOC'
						},
						{
							header: "Unit Price", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'UNIT_PRICE'
						},
						{
							header: "Local Fees", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FEES_LOC'
						},
						{
							header: "Fees", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'FEES'
						},
						{
							header: "Original Face Value", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ORIGINAL_FACE_VALUE'
						},
						{
							header: "Cont Settle Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'CONT_SETTLE_DATE',
							renderer:__formatDate
						},
						{
							header: "Local Taxes", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TAXES_LOC'
						},
						{
							header: "Taxes", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'TAXES'
						},
						{
							header: "Erisa Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ERISA_COST'
						},
						{
							header: "Account Settlement Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACT_SETTLE_DATE',
							renderer:__formatDate
						},
						{
							header: "Local Commission", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COMMISSION_LOC'
						},
						{
							header: "Commission", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'COMMISSION'
						},
						{
							header: "Accounting Period End Date", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'ACCTG_PERIOD_END_DATE',
							renderer:__formatDate
						},
						{
							header: "Local Other Charges", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'OTHER_CHRGS_LOC'
						},
						{
							header: "Other Charges", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'OTHER_CHRGS'
						},
						{
							header: "Local Orig - Average Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'AVG_COST_LOC_ORIG'
						},
						{
							header: "Local Curr - Average Cost", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'AVG_COST_LOC_CURR'
						},
						{
							header: "Local Ex Rate Base", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'EX_RATE_LOC_BASE'
						},
						{
							header: "Settlement Ex Rate", 
							width: 100, sortable: true, locked:false, 
							dataIndex: 'EX_RATE_STL'
						}	
					 ];			
		}
		return dsCols;
	}

	//Method for formating leading zero
	function __leadingZero(nr)
	{
		if (nr < 10)
		{
			nr = "0" + nr;
		}
		return nr;
	}

	//Method to get Current Time	
	function __getCurrentTime()
	{
		var thisdate = new Date();	
		var currHours = __leadingZero(thisdate.getHours());
		var currMinutes = __leadingZero(thisdate.getMinutes());

		var ampm = "AM";
		if (currHours == 0)
		{
			currHours = 12;
		}
		if (currHours > 11)
		{
			ampm = "PM";
		}

		if (currHours > 12)
		{
			currHours -= 12;	
		}

		return currHours+":" + currMinutes + " " + ampm;
	}
	
	//Method to fetch the fund value from the arguments passed
	function __getFundValue(argParams)
	{
		var fndId = ""; 
		if(argParams != null && argParams != undefined && argParams.length > 0)
		{
			var paramArray = argParams.split('&');

			if(paramArray != null)
			{
				for(var i=0;i<paramArray.length;i++)
				{
					if(paramArray[i].indexOf('FUND') >= 0)
					{
						var fundArray = paramArray[i].split('=');
						fndId = fundArray[1];
					}
				}
			}
		}
		return fndId
	}
	
	/**
	 * Description : To Split the Tabs to more than one Tab
	 * param1 : TAB Name
	 * param2 : parameters to be passed to the IDF's
	**/
	function __splitTabGrids(tabName,argStore, baseUrl)
	{
		if(tabName != null && tabName != undefined && tabName != "")
		{
			if(tabName == __CONST_BGMM5)
			{
				argStore = __getDsStore(tabName,argStore, baseUrl);

				var dsMultBasisLotDet = __getDsColumns(__CONST_MULT_LOT_DET);
				var dsLotWithHldDet = __getDsColumns(__CONST_LOT_WITH_DET);
				var dsLotAdjDet = __getDsColumns(__CONST_LOT_ADJ_DET);
				
				__showResearch(__CONST_MULT_LOT_DET, argStore,dsMultBasisLotDet);
				__showResearch(__CONST_LOT_WITH_DET, argStore,dsLotWithHldDet);
				__showResearch(__CONST_LOT_ADJ_DET, argStore,dsLotAdjDet);

				//To make Multibasis Lot Details Active Tab
				var win = __getResearchFixWindow(); 
				var tab = win.getComponent(0);
				tab.setActiveTab(__CONST_MULT_LOT_DET);
			}
		}
	}
	/**
	 * Description: To open tab in the window
	 * param1: Tab Name
	 * param2: Data Store or Columns 
	 * param3: Columns to be displayed in the Grid
	 * param4: Array of Columns to fetched from Grid 
	**/
	function __showResearch(tabName,argStore,argColumns,argCntCols,argIsSplitCols, baseUrl)
	{	
		__baseUrl = baseUrl;	
		if (tabName == null || tabName == undefined)
		{
			// TODO here we want to show the menu opened. tried but didnt work, so just show the window
	        var win = __getResearchFixWindow();
	        win.show();  
			win.findById("mch_emulator_tabs_id").items.first().disable();
	         
			__initParams = argStore;
			__initDefParameters();
			return;
		}		
		
		if(tabName != null && (argStore == undefined || argStore == null)) 
		{
			//To Open Input window
			__onBrowseMenu(tabName);
		}
		else if(argStore == null || argStore == undefined || argStore == "")
		{
			return;
		}

		if (typeof(argStore) == 'string')
		{
			if(argCntCols != null && argCntCols != undefined && argCntCols.length > 0)
			{
				__frmFndInput = "";
				//For storing the initial fund input from the parent window
				__parFndInput = __getFundValue(argStore);
				
				//To Retain the parent populate controls array 
				__parCntlArr = argCntCols;
			}
			if(argIsSplitCols == true)
			{
				__splitTabGrids(tabName,argStore, baseUrl)
				return;
			}
			else
			{
				argStore = __getDsStore(tabName,argStore, baseUrl);
				argColumns = __getDsColumns(tabName);
			}
		}

		if(argStore != null && argColumns != null)
		{
			var win = __getResearchFixWindow();        
			win.show();

			//win.findById("mch_emulator_tabs_id").items.first().disable();
			var tab = win.getComponent(0).getComponent(tabName);

			//Get the Tab Title from the Associative Array
			var tabTitle = __tabTitleArray[tabName];
			if(tabTitle == null || tabTitle == undefined || tabTitle == "")
			{
				tabTitle = tabName;
			}

			if (tab != null)
			{
				win.getComponent(0).remove(tab);
			}
				
			tab = win.getComponent(0).add({
				title: tabTitle,
				id: tabName,				
				iconCls: 'tabs',
				html: '<div id=tab' + tabName + '></div>',
				closable:true
			});
		
			tab.show();

			var gridId  = 'grid_'+tabName;
			
			//Fetch the GridPanel to be rendered to Tab Control
			var grid = __createGridPanel(tabName,argStore,argColumns);
			grid.render('tab'+tabName);
			grid.addListener('rowdblclick', function(){__onReturnClick(tabName,__parCntlArr,gridId,false);});

			argStore.on('load', function(){
				if(argStore.getTotalCount() == 0)
				{
					Ext.MessageBox.show({
					   title: tabName,
					   msg: 'No rows found for given criteria',
					   buttons: Ext.MessageBox.OK,
					   animEl: 'mb4',
					   icon: Ext.MessageBox.INFO
				   });
				}
			});
			argStore.load();			
		}
	}	

	/**
	 * Description: To Create a group By Grid Panel 
	 * param1 : Grid ID
	 * param2 : Data store
	 * param3 : Grid Columns mapping
	**/
	function __createGridPanel(argGridId,argStore,argColumns)
	{
		var xg = Ext.grid;
			
		var grid = new xg.GridPanel({
			store: argStore,
			id:'grid_'+argGridId,						
			columns: argColumns,
	
			view: new Ext.grid.GroupingView({
				//forceFit:true,
				groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
			}),
	
			frame: true,
			header:false,
			width: 783,
			height: 470,
			collapsible: true,
			animCollapse: false,
			title: 'Grouping Example',
			iconCls: 'icon-grid',
			sm: new Ext.grid.RowSelectionModel({singleSelect:true}),
			buttons:[{
						text:'Return',
						id:'btn'+argGridId,
						handler:function(){__onReturnClick(argGridId,__parCntlArr
							,'grid_'+argGridId,true);}
					}],
			buttonAlign:'center',
			loadMask:{
						msg : 'Loading...'
					 }
		});  
		return grid;
	}

	//Method invoked when return button control clicked in the Grid Panel
	function __onReturnClick(argTabName,argCntCols,argId,argIsWinClose)
	{		
		if(argTabName != null && argTabName != undefined)
		{
			var gridObj;
			var rows;
			var paramArr = new Array();

			gridObj = Ext.getCmp(argId);	

			if(gridObj != null && gridObj != undefined)
			{
				rows = gridObj.getSelectionModel().getSelections();
			}
			
			if(rows != null && rows != undefined && rows.length > 0)
			{					
				if(argCntCols != null && argCntCols != undefined && argCntCols.length > 0)
				{
					for(i=0;i<argCntCols.length;i++)
					{
						if(rows[0].get(argCntCols[i]) != null 
							&&  rows[0].get(argCntCols[i]) != undefined)
						{
							paramArr[i] = rows[0].get(argCntCols[i]);
						}							
					}
				}											
			}
			
			if ('function' == typeof window.populateData) 
			{	
				//To check for parent input fund and form Input fund 
				//if equal then populate values in parent window
				if(__parFndInput != null && __parFndInput != undefined 
					&& __parFndInput.length > 0) 
				{
					//To check if parent fund ID and current Input fund ID are same 
					//then populate the controls in parent window by closing 
					//the browse tool otherwise bridge tool must not be closed
					if((__frmFndInput != null && __frmFndInput.length > 0 
						&&__parFndInput == __frmFndInput) 
					|| (__frmFndInput == null || __frmFndInput == undefined 
						|| __frmFndInput == ""))
					{
						//Populate data in parent
						populateData(paramArr,argIsWinClose);
					}
					else
					{
						//Do not populate data
					}
				}
				else
				{	
					//Parent Fund Id is empty
					//Check for closing the modal dialog
					if(argCntCols == null || argCntCols.length == 0)
					{
						populateData(paramArr,argIsWinClose);
					}
				}
							
			} 
			else 
			{
			   // do something else
			}
		}
		
		if(argIsWinClose == true)
		{
			var win = __getResearchFixWindow();        
			win.hide();
		}
	}
	
	//Method to get the current grid index for the Accordion window
	function __getCurrGridIndex(argTabName)
	{
		if(argTabName == __CONST_BGMM)
		{
			__bgmmAccIdx++;
			return (__bgmmAccIdx);
		}
		else if(argTabName == __CONST_BCAR)
		{
			__bcarAccIdx++;
			return (__bcarAccIdx);	
		}
		else if(argTabName == __CONST_BTRD)
		{
			__btrdAccIdx++;
			return (__btrdAccIdx);
		}
		else if(argTabName == __CONST_CTDA)
		{
			__ctdaAccIdx++;
			return (__ctdaAccIdx);	
		}
		return null;
	}	

	//Method to create store
	function __createStore(params, record, loadListener)
	{
		return new Ext.data.Store(
			{
	   			autoLoad: true,
		        url: '?' + params + '&__dotAsUnderscore=true&__dataAsNode=true',
		        listeners : 
		        {
		        	load : loadListener
		        },
		        reader: new Ext.data.XmlReader(
	    		{
	        		record: 'row'
        		}, 
        		record)
	    	});	
	}

	// Method to directly launch input menu for Multi Basis Browse functions
	// Currently supports only 3 MBB Functions ;
	// Will be called from mfa-mch-<dialog>.jsp directly from ehzn-maintenance's menu-context.jsp
    function __onLaunchInputMenu(item)
    {
		__closeAllInputWindow();

	    if(item == __CONST_BRFD)
		{
			__BRFD_showForm();
		}
		else if(item == __CONST_BRKP)
		{
			__BRKP_showForm();
		}
		else if(item == __CONST_BGMM5)
		{
			__BGMM5_showForm();
		}
		else
		{
			alert(item + ' Not found');
		}
    }

	var OSAMCH = 
	{ 
		'rftool' : 
		{
			'show' : __showWindow, 
			'emulator' : 
			{ 
				'show' : __showEmulator 
			},
			'browser' :
			{
				'show' : __showResearch,
				'createStore' : __createStore
			},
			'LaunchInputScreen' : 
			{ 
				'show' : __onLaunchInputMenu
			}			
		}
	};	 